C# Class VSNDK.DebugEngine.AD7ProgramNodeAttach

This class is used only when the user wants to Attach to a running process and it implements: - IDebugProgramNode2. (http://msdn.microsoft.com/en-ca/library/bb146735.aspx) - and IDebugProgram2. (http://msdn.microsoft.com/en-us/library/bb147004.aspx) The Debug Engine does not use this class. It uses AD7ProgramNode.cs. This class is used only to represent each of the running processes that can be attached to the debug engine. When the debug engine attaches to a running process, an AD7ProgramNode class is used to represent the chosen running program. That's why some methods were not implemented. This interface represents a program that can be debugged. A running process is viewed as a ProgramNode by VS. A debug engine (DE) or a custom port supplier implements this interface to represent a program that can be debugged.
Inheritance: IDebugProgramNode2, IDebugProgram2
Exibir arquivo Open project: blackberry/VSPlugin Class Usage Examples

Public Properties

Property Type Description
m_process AD7Process
m_processGuid System.Guid
m_programID string
m_programName string

Public Methods

Method Description
AD7ProgramNodeAttach ( AD7Process proc, System.Guid engineGuid ) : System

Constructor.

Attach ( IDebugEventCallback2 pCallback ) : int

Attaches to the program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb161973.aspx)

Attach_V7 ( IDebugProgram2 pMDMProgram, IDebugEventCallback2 pCallback, uint dwReason ) : int

DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161399.aspx)

CanDetach ( ) : int

Determines if a debug engine (DE) can detach from the program. (http://msdn.microsoft.com/en-us/library/bb161967.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.

CauseBreak ( ) : int

Requests that the program stop execution the next time one of its threads attempts to run. The debugger calls CauseBreak when the user clicks on the pause button in VS. The debugger should respond by entering breakmode. (http://msdn.microsoft.com/en-us/library/bb145018.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.

Continue ( IDebugThread2 pThread ) : int

Continues running this program from a stopped state. Any previous execution state (such as a step) is preserved, and the program starts executing again. (http://msdn.microsoft.com/en-us/library/bb162148.aspx). Not implemented because this class is not used by the debug engine. Read the description of this class at the top.

Detach ( ) : int

Detaches a debug engine from the program. (http://msdn.microsoft.com/en-us/library/bb146228.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.

DetachDebugger_V7 ( ) : int

DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161803.aspx)

EnumCodeContexts ( IDebugDocumentPosition2 pDocPos, IEnumDebugCodeContexts2 &ppEnum ) : int

Retrieves a list of the code contexts for a given position in a source file. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145902.aspx)

EnumCodePaths ( string Hint, IDebugCodeContext2 start, IDebugStackFrame2 frame, int fSource, IEnumCodePaths2 &pathEnum, IDebugCodeContext2 &safetyContext ) : int

Retrieves a list of the code paths for a given position in a source file. EnumCodePaths is used for the step-into specific feature -- right click on the current statement and decide which function to step into. This is not something that the VSNDK debug engine supports. (http://msdn.microsoft.com/en-us/library/bb162326.aspx)

EnumModules ( IEnumDebugModules2 &ppEnum ) : int

Retrieves a list of the modules that this program has loaded and is executing. (http://msdn.microsoft.com/en-us/library/bb146980.aspx)

EnumThreads ( IEnumDebugThreads2 &ppEnum ) : int

Retrieves a list of the threads that are running in the program. (http://msdn.microsoft.com/en-us/library/bb145110.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.

Execute ( ) : int

Continues running this program from a stopped state. Any previous execution state (such as a step) is cleared, and the program starts executing again. Not implemented. (http://msdn.microsoft.com/en-us/library/bb162315.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.

GetDebugProperty ( IDebugProperty2 &ppProperty ) : int

Gets the program's properties. The VSNDK debug engine does not support this. (http://msdn.microsoft.com/en-us/library/bb161801.aspx)

GetDisassemblyStream ( enum_DISASSEMBLY_STREAM_SCOPE dwScope, IDebugCodeContext2 codeContext, IDebugDisassemblyStream2 &disassemblyStream ) : int

Gets the disassembly stream for this program or a part of this program. The sample engine does not support dissassembly so it returns E_NOTIMPL

GetENCUpdate ( object &update ) : int

This method gets the Edit and Continue (ENC) update for this program. A custom debug engine always returns E_NOTIMPL

GetEngineInfo ( string &engineName, System.Guid &engineGuid ) : int

Gets the name and GUID of the debug engine running this program. (http://msdn.microsoft.com/en-ca/library/bb146303.aspx)

GetHostMachineName_V7 ( string &hostMachineName ) : int

DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161297.aspx)

GetHostName ( enum_GETHOSTNAME_TYPE dwHostNameType, string &processName ) : int

Gets the name of the process hosting a program. (http://msdn.microsoft.com/en-us/library/bb145135.aspx)

GetHostPid ( AD_PROCESS_ID pHostProcessId ) : int

Gets the system process identifier for the process hosting a program. (http://msdn.microsoft.com/en-us/library/bb162159.aspx)

GetMemoryBytes ( IDebugMemoryBytes2 &ppMemoryBytes ) : int

Retrieves the memory bytes occupied by the program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145291.aspx)

GetName ( string &programName ) : int

Gets the name of the program. The name returned by this method is always a friendly, user-displayable name that describes the program. (http://msdn.microsoft.com/en-us/library/bb161279.aspx)

GetProcess ( IDebugProcess2 &process ) : int

Get the process that this program is running in. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145293.aspx)

GetProgramId ( System.Guid &guidProgramId ) : int

Gets a GUID for this program. A debug engine (DE) must return the program identifier originally passed to the IDebugProgramNodeAttach2::OnAttach or IDebugEngine2::Attach methods. This allows identification of the program across debugger components. (http://msdn.microsoft.com/en-us/library/bb145581.aspx)

Step ( IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step ) : int

Performs a step. This method is deprecated. Use the IDebugProcess3::Step method instead. (http://msdn.microsoft.com/en-us/library/bb162134.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.

Terminate ( ) : int

Terminates the program. (http://msdn.microsoft.com/en-us/library/bb145919.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.

WriteDump ( enum_DUMPTYPE DUMPTYPE, string pszDumpUrl ) : int

Writes a dump to a file. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145827.aspx)

Private Methods

Method Description
IDebugProgramNode2 ( string &programName ) : int

Gets the name of a program. (http://msdn.microsoft.com/en-us/library/bb145928.aspx)

Method Details

AD7ProgramNodeAttach() public method

Constructor.
public AD7ProgramNodeAttach ( AD7Process proc, System.Guid engineGuid ) : System
proc AD7Process
engineGuid System.Guid The GUID of the VSNDK debug engine.
return System

Attach() public method

Attaches to the program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb161973.aspx)
public Attach ( IDebugEventCallback2 pCallback ) : int
pCallback IDebugEventCallback2
return int

Attach_V7() public method

DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161399.aspx)
public Attach_V7 ( IDebugProgram2 pMDMProgram, IDebugEventCallback2 pCallback, uint dwReason ) : int
pMDMProgram IDebugProgram2 The IDebugProgram2 interface that represents the program to attach to.
pCallback IDebugEventCallback2 The IDebugEventCallback2 interface to be used to send debug events to the SDM.
dwReason uint A value from the ATTACH_REASON enumeration that specifies the reason for attaching.
return int

CanDetach() public method

Determines if a debug engine (DE) can detach from the program. (http://msdn.microsoft.com/en-us/library/bb161967.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
public CanDetach ( ) : int
return int

CauseBreak() public method

Requests that the program stop execution the next time one of its threads attempts to run. The debugger calls CauseBreak when the user clicks on the pause button in VS. The debugger should respond by entering breakmode. (http://msdn.microsoft.com/en-us/library/bb145018.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
public CauseBreak ( ) : int
return int

Continue() public method

Continues running this program from a stopped state. Any previous execution state (such as a step) is preserved, and the program starts executing again. (http://msdn.microsoft.com/en-us/library/bb162148.aspx). Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
public Continue ( IDebugThread2 pThread ) : int
pThread IDebugThread2 An IDebugThread2 object that represents the thread.
return int

Detach() public method

Detaches a debug engine from the program. (http://msdn.microsoft.com/en-us/library/bb146228.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
public Detach ( ) : int
return int

DetachDebugger_V7() public method

DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161803.aspx)
public DetachDebugger_V7 ( ) : int
return int

EnumCodeContexts() public method

Retrieves a list of the code contexts for a given position in a source file. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145902.aspx)
public EnumCodeContexts ( IDebugDocumentPosition2 pDocPos, IEnumDebugCodeContexts2 &ppEnum ) : int
pDocPos IDebugDocumentPosition2 An object representing an abstract position in a source file known to the IDE.
ppEnum IEnumDebugCodeContexts2 Returns an IEnumDebugCodeContexts2 object that contains a list of the code contexts.
return int

EnumCodePaths() public method

Retrieves a list of the code paths for a given position in a source file. EnumCodePaths is used for the step-into specific feature -- right click on the current statement and decide which function to step into. This is not something that the VSNDK debug engine supports. (http://msdn.microsoft.com/en-us/library/bb162326.aspx)
public EnumCodePaths ( string Hint, IDebugCodeContext2 start, IDebugStackFrame2 frame, int fSource, IEnumCodePaths2 &pathEnum, IDebugCodeContext2 &safetyContext ) : int
Hint string
start IDebugCodeContext2 An IDebugCodeContext2 object representing the current code context.
frame IDebugStackFrame2 An IDebugStackFrame2 object representing the stack frame associated with the current breakpoint.
fSource int Nonzero (TRUE) if in the Source view, or zero (FALSE) if in the Disassembly view.
pathEnum IEnumCodePaths2 Returns an IEnumCodePaths2 object containing a list of the code paths.
safetyContext IDebugCodeContext2 Returns an IDebugCodeContext2 object representing an additional code context to be set as a /// breakpoint in case the chosen code path is skipped. This can happen in the case of a short-circuited Boolean expression, /// for example.
return int

EnumModules() public method

Retrieves a list of the modules that this program has loaded and is executing. (http://msdn.microsoft.com/en-us/library/bb146980.aspx)
public EnumModules ( IEnumDebugModules2 &ppEnum ) : int
ppEnum IEnumDebugModules2 Returns an IEnumDebugModules2 object that contains a list of the modules.
return int

EnumThreads() public method

Retrieves a list of the threads that are running in the program. (http://msdn.microsoft.com/en-us/library/bb145110.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
public EnumThreads ( IEnumDebugThreads2 &ppEnum ) : int
ppEnum IEnumDebugThreads2 Returns an IEnumDebugThreads2 object that contains a list of the threads.
return int

Execute() public method

Continues running this program from a stopped state. Any previous execution state (such as a step) is cleared, and the program starts executing again. Not implemented. (http://msdn.microsoft.com/en-us/library/bb162315.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
public Execute ( ) : int
return int

GetDebugProperty() public method

Gets the program's properties. The VSNDK debug engine does not support this. (http://msdn.microsoft.com/en-us/library/bb161801.aspx)
public GetDebugProperty ( IDebugProperty2 &ppProperty ) : int
ppProperty IDebugProperty2 Returns an IDebugProperty2 object that represents the program's properties.
return int

GetDisassemblyStream() public method

Gets the disassembly stream for this program or a part of this program. The sample engine does not support dissassembly so it returns E_NOTIMPL
public GetDisassemblyStream ( enum_DISASSEMBLY_STREAM_SCOPE dwScope, IDebugCodeContext2 codeContext, IDebugDisassemblyStream2 &disassemblyStream ) : int
dwScope enum_DISASSEMBLY_STREAM_SCOPE Specifies a value from the DISASSEMBLY_STREAM_SCOPE enumeration that defines the scope of the /// disassembly stream.
codeContext IDebugCodeContext2 An object that represents the position of where to start the disassembly stream.
disassemblyStream IDebugDisassemblyStream2 Returns an IDebugDisassemblyStream2 object that represents the disassembly stream.
return int

GetENCUpdate() public method

This method gets the Edit and Continue (ENC) update for this program. A custom debug engine always returns E_NOTIMPL
public GetENCUpdate ( object &update ) : int
update object Returns an internal interface that can be used to update this program.
return int

GetEngineInfo() public method

Gets the name and GUID of the debug engine running this program. (http://msdn.microsoft.com/en-ca/library/bb146303.aspx)
public GetEngineInfo ( string &engineName, System.Guid &engineGuid ) : int
engineName string Returns the name of the DE running this program.
engineGuid System.Guid Returns the GUID of the DE running this program.
return int

GetHostMachineName_V7() public method

DEPRECATED. DO NOT USE. (http://msdn.microsoft.com/en-us/library/bb161297.aspx)
public GetHostMachineName_V7 ( string &hostMachineName ) : int
hostMachineName string Returns the name of the machine in which the program is running.
return int

GetHostName() public method

Gets the name of the process hosting a program. (http://msdn.microsoft.com/en-us/library/bb145135.aspx)
public GetHostName ( enum_GETHOSTNAME_TYPE dwHostNameType, string &processName ) : int
dwHostNameType enum_GETHOSTNAME_TYPE A value from the GETHOSTNAME_TYPE enumeration that specifies the type of name to return.
processName string Returns the name of the hosting process.
return int

GetHostPid() public method

Gets the system process identifier for the process hosting a program. (http://msdn.microsoft.com/en-us/library/bb162159.aspx)
public GetHostPid ( AD_PROCESS_ID pHostProcessId ) : int
pHostProcessId AD_PROCESS_ID Returns the system process identifier for the hosting process.
return int

GetMemoryBytes() public method

Retrieves the memory bytes occupied by the program. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145291.aspx)
public GetMemoryBytes ( IDebugMemoryBytes2 &ppMemoryBytes ) : int
ppMemoryBytes IDebugMemoryBytes2 Returns an IDebugMemoryBytes2 object that represents the memory bytes of the program.
return int

GetName() public method

Gets the name of the program. The name returned by this method is always a friendly, user-displayable name that describes the program. (http://msdn.microsoft.com/en-us/library/bb161279.aspx)
public GetName ( string &programName ) : int
programName string Returns the name of the program.
return int

GetProcess() public method

Get the process that this program is running in. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145293.aspx)
public GetProcess ( IDebugProcess2 &process ) : int
process IDebugProcess2 Returns the IDebugProcess2 interface that represents the process.
return int

GetProgramId() public method

Gets a GUID for this program. A debug engine (DE) must return the program identifier originally passed to the IDebugProgramNodeAttach2::OnAttach or IDebugEngine2::Attach methods. This allows identification of the program across debugger components. (http://msdn.microsoft.com/en-us/library/bb145581.aspx)
public GetProgramId ( System.Guid &guidProgramId ) : int
guidProgramId System.Guid Returns the GUID for this program.
return int

Step() public method

Performs a step. This method is deprecated. Use the IDebugProcess3::Step method instead. (http://msdn.microsoft.com/en-us/library/bb162134.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
public Step ( IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step ) : int
pThread IDebugThread2 An IDebugThread2 object that represents the thread being stepped.
sk enum_STEPKIND A value from the STEPKIND enumeration that specifies the kind of step.
Step enum_STEPUNIT A value from the STEPUNIT enumeration that specifies the unit of step.
return int

Terminate() public method

Terminates the program. (http://msdn.microsoft.com/en-us/library/bb145919.aspx) Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
public Terminate ( ) : int
return int

WriteDump() public method

Writes a dump to a file. Not implemented. (http://msdn.microsoft.com/en-us/library/bb145827.aspx)
public WriteDump ( enum_DUMPTYPE DUMPTYPE, string pszDumpUrl ) : int
DUMPTYPE enum_DUMPTYPE A value from the DUMPTYPE enumeration that specifies the type of dump, for example, short or /// long.
pszDumpUrl string The URL to write the dump to. Typically, this is in the form of file://c:\path\filename.ext, /// but may be any valid URL.
return int

Property Details

m_process public_oe property

The hosting process.
public AD7Process,VSNDK.DebugEngine m_process
return AD7Process

m_processGuid public_oe property

The GUID of the hosting process.
public Guid,System m_processGuid
return System.Guid

m_programID public_oe property

The ID of the program to be debugged.
public string m_programID
return string

m_programName public_oe property

The program friendly name.
public string m_programName
return string