Export (0) Print
Expand All

Debugger.DebuggedProcesses Property

Gets the list of processes currently being debugged.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

Processes DebuggedProcesses { get; }
/** @property */
Processes get_DebuggedProcesses ()

function get DebuggedProcesses () : Processes

Property Value

A Processes collection.

DebuggedProcesses returns a Processes collection representing those processes currently being debugged.

The following example demonstrates how to use the DebuggedProcesses property.

To test this property:

  1. Set a breakpoint in the target application. Run the add-in.

    No processes are being debugged.

  2. Set a breakpoint in the target application. Run the target. When the application stops at the breakpoint, run the add-in.

    The process is being debugged.

public static void DebuggedProcesses(DTE dte)
{
    // Setup the debug Output window.
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Debugged Processes Test");
    owp.Activate();

    EnvDTE.Processes processes = dte.Debugger.DebuggedProcesses;
    if(processes.Count == 0)
        owp.OutputString("No processes are being debugged.");
    else
        foreach(EnvDTE.Process proc in processes)
            owp.OutputString("\nProcess: [" + proc.ProcessID + "] " + 
                             proc.Name);
}

Community Additions

ADD
Show:
© 2014 Microsoft