IDiaSession
Provides a query context for debug symbols.
IDiaSession : IUnknown
Methods
The following table shows the methods of IDiaSession.
Method |
Description |
---|---|
Retrieves the load address for the executable file that corresponds to the symbols in this symbol store. This is the same value that was passed to the put_loadAddress method. |
|
Sets the load address for the executable file that corresponds to the symbols in this symbol store. Note It is important to call this method when you get an IDiaSession object and before you start using the object. |
|
Retrieves a reference to the global scope. |
|
Retrieves an enumerator for all tables contained in the symbol store. |
|
Retrieves an enumerator for all named symbols at static locations. |
|
Retrieves all children of a specified parent identifier that match the name and symbol type. |
|
Retrieves a specified symbol type that contains, or is closest to, a specified address. |
|
Retrieves a specified symbol type that contains, or is closest to, a specified relative virtual address (RVA). |
|
Retrieves a specified symbol type that contains, or is closest to, a specified virtual address (VA). |
|
Retrieves the symbol that contains a specified metadata token. |
|
Checks to see if two symbols are equivalent. |
|
Retrieves a symbol by its unique identifier. |
|
Retrieves a specified symbol type that contains, or is closest to, a specified relative virtual address and offset. |
|
Retrieves a specified symbol type that contains, or is closest to, a specified virtual address and offset. |
|
Retrieves a source file by compiland and name. |
|
Retrieves a source file by source file identifier. |
|
Retrieves line numbers within a specified compiland and source file identifier. |
|
Retrieves the lines in a specified compiland that contain a specified address. |
|
Retrieves the lines in a specified compiland that contain a specified relative virtual address. |
|
Finds the line number information for lines contained in a specified address range. |
|
Retrieves the lines in a specified compiland by source file and line number. |
|
Retrieves a source that has been placed into the symbol store by attribute providers or other components of the compilation process. |
|
Retrieves an enumerated sequence of debug data streams. |
|
Retrieves an enumeration that allows a client to iterate through all of the inline frames on a given address. |
|
Retrieves an enumeration that allows a client to iterate through all of the inline frames on a specified relative virtual address (RVA). |
|
Retrieves an enumeration that allows a client to iterate through all of the inline frames on a specified virtual address (VA). |
|
Retrieves an enumeration that allows a client to iterate through the line number information of all functions that are inlined, directly or indirectly, by the specified parent symbol. |
|
Retrieves an enumeration that allows a client to iterate through the line number information of all functions that are inlined, directly or indirectly, by the specified parent symbol and are contained within the specified address range. |
|
Retrieves an enumeration that allows a client to iterate through the line number information of all functions that are inlined, directly or indirectly, by the specified parent symbol and are contained within the specified relative virtual address (RVA). |
|
Retrieves an enumeration that allows a client to iterate through the line number information of all functions that are inlined, directly or indirectly, by the specified parent symbol and are contained within the specified virtual address (VA). |
|
Retrieves an enumeration that allows a client to iterate through the line number information of all functions that are inlined, directly or indirectly, in the specified source file and line number. |
|
Retrieves an enumeration that allows a client to iterate through the line number information of all inlined functions that match a specified name. |
|
Returns an enumeration of symbols for the variable that the specified tag value corresponds to in the parent Accelerator stub function. |
|
Given a corresponding tag value, this method returns an enumeration of symbols that are contained in a specified parent Accelerator stub function at a specified relative virtual address. |
|
Returns an enumeration of symbols for inline frames corresponding to the specified inline function name. |
|
Returns an enumeration of symbols for inline frames that correspond to the specified source location. |
Remarks
It is important to call the IDiaSession::put_loadAddress method after creating the IDiaSession object — and the value passed to the put_loadAddress method must be non-zero — for any virtual address (VA) properties of symbols to be accessible. The load address comes from whatever program loaded the executable being debugged. For example, you can call the Win32 function GetModuleInformation to retrieve the load address for the executable, given a handle to the executable.
Example
This example shows how to obtain the IDiaSession interface as part of a general initialization of the DIA SDK.
CComPtr<IDiaDataSource> pSource;
ComPtr<IDiaSession> psession;
void InitializeDIA(const char *szFilename)
{
HRESULT hr = CoCreateInstance( CLSID_DiaSource,
NULL,
CLSCTX_INPROC_SERVER,
__uuidof( IDiaDataSource ),
(void **) &pSource);
if (FAILED(hr))
{
Fatal("Could not CoCreate CLSID_DiaSource. Register msdia80.dll." );
}
wchar_t wszFilename[ _MAX_PATH ];
mbstowcs( wszFilename,
szFilename,
sizeof( wszFilename )/sizeof( wszFilename[0] ) );
if ( FAILED( pSource->loadDataFromPdb( wszFilename ) ) )
{
if ( FAILED( pSource->loadDataForExe( wszFilename, NULL, NULL ) ) )
{
Fatal( "loadDataFromPdb/Exe" );
}
}
if ( FAILED( pSource->openSession( &psession ) ) )
{
Fatal( "openSession" );
}
}
Requirements
Header: Dia2.h
Library: diaguids.lib
DLL: msdia80.dll