Ejemplo n.º 1
0
        protected override void ProcessRecord()
        {
            ConnectionState state = ConnectionState.GetConnectionState();

            state.IsConnected = true;
            state.ProcessPath = ProcessPath;

            if (SymbolPath == null)
            {
                SymbolPath = "srv*";
            }

            IDebugClient client = DebugClient.DebugCreateEx(0x60);

            ((IDebugSymbols5)client).SetSymbolPathWide(SymbolPath);
            ((IDebugClient7)client).CreateProcessAndAttach(0, ProcessPath, DebugCreateProcess.DebugOnlyThisProcess, 0, DebugAttach.Default);
            ((IDebugControl7)client).WaitForEvent(0, uint.MaxValue);

            // For live debugging disable caching.
            //
            Context.EnableUserCastedVariableCaching = false;
            Context.EnableVariableCaching           = false;

            IDebuggerEngine debugger       = new DbgEngDll(client);
            ISymbolProvider symbolProvider = new DiaSymbolProvider(debugger.GetDefaultSymbolProvider());

            Context.InitializeDebugger(debugger, symbolProvider);

            WriteDebug("Connection successfully initialized");
        }
Ejemplo n.º 2
0
        protected override void ProcessRecord()
        {
            ConnectionState state = ConnectionState.GetConnectionState();

            state.IsConnected = true;
            state.ProcessPath = ProcessPath;

            if (SymbolPath == null)
            {
                SymbolPath = "srv*";
            }

            IDebugClient client = DebugClient.DebugCreateEx(0x60);

            ((IDebugSymbols5)client).SetSymbolPathWide(SymbolPath);
            ((IDebugClient7)client).CreateProcessAndAttach(0, ProcessPath, 0x00000002);
            ((IDebugControl7)client).WaitForEvent(0, uint.MaxValue);

            // For live debugging disable caching.
            //
            Context.EnableUserCastedVariableCaching = false;
            Context.EnableVariableCaching           = false;

            Context.Initalize(client);


            WriteDebug("Connection successfully initialized");
        }
Ejemplo n.º 3
0
        public void TestInitialize()
        {
            Task mtaTask = new Task(() =>
            {
                //Initialize(DefaultDumpFile, DefaultSymbolPath);
                new Executor().InitializeContext(DebugClient.DebugCreateEx(0));
            });

            mtaTask.Start();
            mtaTask.Wait();
        }