Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("ClrInspector at work...");

            ProcessStartInfo psi = new ProcessStartInfo(@"C:\Tools\sscli\ClrAddin\ClrTestApp\bin\Debug\ClrTestApp.exe");

            Process process = Process.Start(psi);

            Thread.Sleep(5000);

            Dac dac = new Dac(process);
            ThreadStackManager tsm = dac.ConstructThreadStacks();


            Console.ReadLine();
            process.Kill();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("ClrInspector at work...");

            ProcessStartInfo psi = new ProcessStartInfo(@"C:\Tools\sscli\ClrAddin\ClrTestApp\bin\Debug\ClrTestApp.exe");

            Process process = Process.Start(psi);
            Thread.Sleep(5000);

            Dac dac = new Dac(process);
            ThreadStackManager tsm = dac.ConstructThreadStacks();


            Console.ReadLine();
            process.Kill();

        }
        private void ProcessBreakMode()
        {
            try
            {
                Process2 process = (Process2)r_dte.Debugger.DebuggedProcesses.Item(1);

                Dictionary <int, String> threadNames = new Dictionary <int, string>();
                Threads threads = process.Threads;
                int     count   = threads.Count;
                for (int i = 1; i <= count; ++i)
                {
                    Thread thread = threads.Item(i);
                    int    id     = thread.ID;
                    String name   = thread.Name;
                    threadNames.Add(id, name);
                }

                int procid = process.ProcessID;
                System.Diagnostics.Process proc = System.Diagnostics.Process.GetProcessById(procid);

                using (Dac dac = new Dac(proc))
                {
                    ThreadStackManager  man    = dac.ConstructThreadStacks();
                    VisualStudioProcess vsProc = new VisualStudioProcess(process);
                    r_myControl.Refresh(man, vsProc, threadNames);
                }
            }
            catch (ExpiredException ex)
            {
                r_myControl.Refresh(ex);
            }
            catch (Exception ex)
            {
                r_myControl.Refresh(ex);
            }
        }
        private void ProcessBreakMode()
        {
            try
            {
                Process2 process = (Process2)r_dte.Debugger.DebuggedProcesses.Item(1);

                Dictionary<int, String> threadNames = new Dictionary<int, string>();
                Threads threads = process.Threads;
                int count = threads.Count;
                for (int i = 1; i <= count; ++i)
                {
                    Thread thread = threads.Item(i);
                    int id = thread.ID;
                    String name = thread.Name;
                    threadNames.Add(id, name);
                }

                int procid = process.ProcessID;
                System.Diagnostics.Process proc = System.Diagnostics.Process.GetProcessById(procid);

                using (Dac dac = new Dac(proc))
                {
                    ThreadStackManager man = dac.ConstructThreadStacks();
                    VisualStudioProcess vsProc = new VisualStudioProcess(process);
                    r_myControl.Refresh(man, vsProc, threadNames);
                }
            }
            catch (ExpiredException ex)
            {
                r_myControl.Refresh(ex);
            }
            catch (Exception ex)
            {
                r_myControl.Refresh(ex);
            }
        }