mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-19 19:13:22 +08:00
[0.1.x] added : getPdbFile routine
git-svn-id: https://pykd.svn.codeplex.com/svn@72299 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
ef857b33d8
commit
e44a8c41f1
@ -285,6 +285,39 @@ ULONG64 getOffset( const std::wstring symbolname )
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string DebugClient::getPdbFile( ULONG64 moduleBase )
|
||||
{
|
||||
HRESULT hres;
|
||||
IMAGEHLP_MODULEW64 imageHelpInfo = { 0 };
|
||||
|
||||
hres =
|
||||
m_advanced->GetSymbolInformation(
|
||||
DEBUG_SYMINFO_IMAGEHLP_MODULEW64,
|
||||
moduleBase,
|
||||
0,
|
||||
&imageHelpInfo,
|
||||
sizeof( imageHelpInfo ),
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
NULL );
|
||||
|
||||
if ( FAILED( hres ) )
|
||||
throw DbgException( "IDebugAdvanced2::GetSymbolInformation failed" );
|
||||
|
||||
char fileName[ 256 ];
|
||||
WideCharToMultiByte( CP_ACP, 0, imageHelpInfo.LoadedPdbName, 256, fileName, 256, NULL, NULL );
|
||||
|
||||
return std::string( fileName );
|
||||
}
|
||||
|
||||
std::string getPdbFile( ULONG64 moduleBase )
|
||||
{
|
||||
return g_dbgClient->getPdbFile( moduleBase );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void DebugClient::setExecutionStatus( ULONG status )
|
||||
{
|
||||
HRESULT hres;
|
||||
|
@ -95,6 +95,8 @@ public:
|
||||
|
||||
ULONG64 getOffset( const std::wstring symbolname );
|
||||
|
||||
std::string getPdbFile( ULONG64 moduleBase );
|
||||
|
||||
template<ULONG status>
|
||||
void changeDebuggerStatus();
|
||||
|
||||
@ -271,6 +273,8 @@ ULONG getExecutionStatus();
|
||||
|
||||
ULONG64 getOffset( const std::wstring symbolname );
|
||||
|
||||
std::string getPdbFile( ULONG64 moduleBase );
|
||||
|
||||
bool is64bitSystem();
|
||||
|
||||
bool isKernelDebugging();
|
||||
|
@ -164,6 +164,8 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
"Return information about the execution status of the debugger" )
|
||||
.def( "getOffset", &DebugClient::getOffset,
|
||||
"Return traget virtual address for specified symbol" )
|
||||
.def( "getPdbFile", &DebugClient::getPdbFile,
|
||||
"Return full path to PDB (Program DataBase, debug information) file" )
|
||||
.def( "go", &DebugClient::changeDebuggerStatus<DEBUG_STATUS_GO>,
|
||||
"Change debugger status to DEBUG_STATUS_GO" )
|
||||
.def( "is64bitSystem", &DebugClient::is64bitSystem,
|
||||
@ -287,6 +289,8 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
"Return information about the execution status of the debugger" );
|
||||
python::def( "getOffset", &getOffset,
|
||||
"Return traget virtual address for specified symbol" );
|
||||
python::def( "getPdbFile", &getPdbFile,
|
||||
"Return full path to PDB (Program DataBase, debug information) file" );
|
||||
python::def( "go", &changeDebuggerStatus<DEBUG_STATUS_GO>,
|
||||
"Change debugger status to DEBUG_STATUS_GO" );
|
||||
python::def( "is64bitSystem", &is64bitSystem,
|
||||
|
@ -22,6 +22,9 @@ class DbgClientTest( unittest.TestCase ):
|
||||
pykd.waitForEvent()
|
||||
self.assertEqual( pykd.DEBUG_STATUS_BREAK, pykd.getExecutionStatus() )
|
||||
|
||||
def testPdbFile( self ):
|
||||
self.assertNotEqual( '', target.module )
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user