Beispiel #1
0
        // Initialize this extension. We can only initialize global (non-process specific) state right now
        // since we may not have an active process.
        // However, we can subscribe to the ProcessAdded event to register per-process state.
        public static void Initialize()
        {
            g_rm = new System.Resources.ResourceManager("mdbgCommands", System.Reflection.Assembly.GetExecutingAssembly());
            MDbgAttributeDefinedCommand.AddCommandsFromType(Shell.Commands, typeof(MdbgCommands));

            g_lastSavedRunCommand = null;
            g_threadNickNames = new ThreadNickNames();
            SymbolCache = new MDbgSymbolCache();
            m_events = new ArrayList();
            m_loadedExtensions = new Dictionary<string, bool>();

            // initialization of various properties
            InitModeShellProperty();
            InitStopOptionsProperty();

            Debug.Assert(Shell.Debugger != null);

            // Install our default breakpoint parser.
            if (Shell.BreakpointParser == null)
            {
                Shell.BreakpointParser = new DefaultBreakpointParser();
            }
            if (Shell.ExpressionParser == null)
            {
                Shell.ExpressionParser = new DefaultExpressionParser();
            }

            // We could subscribe to process-specific event handlers via the the Shell.Debugger.Processes.ProcessAdded event.
            Shell.Debugger.Processes.ProcessAdded += new ProcessCollectionChangedEventHandler(Processes_ProcessAdded);
        }
Beispiel #2
0
        private void InitDebugging()
        {
            this.configuration = ReadConfiguration(options.Config);
            SymbolCache        = new MDbgSymbolCache();
            Debugger           = new MDbgEngine();
            BreakpointParser   = new DefaultBreakpointParser(this);
            FileLocator        = new MDbgFileLocator();
            SourceFileMgr      = new MDbgSourceFileMgr();
            PdbSymbolCache     = new PdbSymbolCache(configuration.assemblies.Select(a => a.path), this);
            languageUtils      = new List <ILanguageUtil>(new[] { new CSharpLanguageUtil() });

            methodLocators = new Dictionary <string, MethodLocator>();
            foreach (var assembly in configuration.assemblies)
            {
                methodLocators[assembly.path] = new MethodLocator(assembly.path, assembly.language, this);
            }
        }
Beispiel #3
0
        // Initialize this extension. We can only initialize global (non-process specific) state right now
        // since we may not have an active process.
        // However, we can subscribe to the ProcessAdded event to register per-process state.
        public static void Initialize()
        {
            //g_rm = new System.Resources.ResourceManager("mdbgCommands",System.Reflection.Assembly.GetExecutingAssembly());
            g_rm = new ResourceManager(typeof (mdbgCommands));

            // DC: function helper when moving functions to mdbgCommandsCustomizedForO2
            // , O2Thread.FuncVoid<string> o2Callback)
            //O2.Debugger.Mdbg.OriginalMdbgCode.mdbg.mdbgCommandsCustomizedForO2


            CommandDescriptionAttribute.RegisterResourceMgr(typeof (MdbgCommands), g_rm);
            MDbgAttributeDefinedCommand.AddCommandsFromType(Shell.Commands, typeof (MdbgCommands));

            g_lastSavedRunCommand = null;
            g_threadNickNames = new ThreadNickNames();
            SymbolCache = new MDbgSymbolCache();
            m_events = new ArrayList();

            // initialization of various properties
            InitModeShellProperty();
            InitStopOptionsProperty();

            Debug.Assert(Shell.Debugger != null);

            // Install our default breakpoint parser.
            if (Shell.BreakpointParser == null)
            {
                Shell.BreakpointParser = new DefaultBreakpointParser();
            }
            if (Shell.ExpressionParser == null)
            {
                Shell.ExpressionParser = new DefaultExpressionParser();
            }

            // We could subscribe to process-specific event handlers via the the Shell.Debugger.Processes.ProcessAdded event.
            Shell.Debugger.Processes.ProcessAdded += Processes_ProcessAdded;
        }