mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 04:13:22 +08:00
[0.1.x] removed : findModule routine ( use overloaded loadModule routine )
git-svn-id: https://pykd.svn.codeplex.com/svn@71751 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
816827ec9f
commit
07f0d3a0fb
@ -91,11 +91,11 @@ public:
|
||||
|
||||
void loadDump( const std::wstring &fileName );
|
||||
|
||||
Module loadModule( const std::string &moduleName ) {
|
||||
Module loadModuleByName( const std::string &moduleName ) {
|
||||
return Module( m_client, moduleName );
|
||||
}
|
||||
|
||||
Module findModule( ULONG64 offset ) {
|
||||
Module loadModuleByOffset( ULONG64 offset ) {
|
||||
return Module( m_client, offset );
|
||||
}
|
||||
|
||||
|
@ -201,9 +201,9 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
"Read an pointer value from the target memory" )
|
||||
.def( "loadExt", &pykd::DebugClient::loadExtension,
|
||||
"Load a debuger extension" )
|
||||
.def( "loadModule", &pykd::DebugClient::loadModule,
|
||||
.def( "loadModule", &pykd::DebugClient::loadModuleByName,
|
||||
"Return instance of Module class" )
|
||||
.def( "findModule", &pykd::DebugClient::findModule,
|
||||
.def( "loadModule", &pykd::DebugClient::loadModuleByOffset,
|
||||
"Return instance of the Module class which posseses specified address" )
|
||||
.def( "dbgCommand", &pykd::DebugClient::dbgCommand,
|
||||
"Run a debugger's command and return it's result as a string" )
|
||||
@ -294,12 +294,11 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
"Read an signed mashine's word wide integer from the target memory" );
|
||||
python::def( "ptrPtr", &ptrPtr,
|
||||
"Read an pointer value from the target memory" );
|
||||
|
||||
python::def( "loadExt", &pykd::loadExtension,
|
||||
"Load a debuger extension" );
|
||||
python::def( "loadModule", &pykd::loadModule,
|
||||
python::def( "loadModule", &loadModuleByName,
|
||||
"Return instance of Module class" );
|
||||
python::def( "findModule", &pykd::findModule,
|
||||
python::def( "loadModule", &loadModuleByOffset,
|
||||
"Return instance of the Module class which posseses specified address" );
|
||||
python::def( "dbgCommand", &pykd::dbgCommand,
|
||||
"Run a debugger's command and return it's result as a string" ),
|
||||
|
@ -8,14 +8,14 @@ namespace pykd {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Module loadModule( const std::string &moduleName ) {
|
||||
return g_dbgClient->loadModule( moduleName );
|
||||
Module loadModuleByName( const std::string &moduleName ) {
|
||||
return g_dbgClient->loadModuleByName( moduleName );
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Module findModule( ULONG64 offset ) {
|
||||
return g_dbgClient->findModule( offset );
|
||||
Module loadModuleByOffset( ULONG64 offset ) {
|
||||
return g_dbgClient->loadModuleByOffset( offset );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -89,9 +89,9 @@ private:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Module loadModule( const std::string &moduleName );
|
||||
Module loadModuleByName( const std::string &moduleName ) ;
|
||||
|
||||
Module findModule( ULONG64 offset );
|
||||
Module loadModuleByOffset( ULONG64 offset );
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -26,7 +26,6 @@ class BaseTest( unittest.TestCase ):
|
||||
self.assertTrue( hasattr(pykd, 'delSynSymbol') )
|
||||
self.assertTrue( hasattr(pykd, 'delSynSymbolsMask') )
|
||||
self.assertTrue( hasattr(pykd, 'expr') )
|
||||
self.assertTrue( hasattr(pykd, 'findModule') )
|
||||
self.assertTrue( hasattr(pykd, 'findSymbol') )
|
||||
self.assertTrue( hasattr(pykd, 'getCurrentProcess') )
|
||||
self.assertTrue( hasattr(pykd, 'getCurrentStack') )
|
||||
@ -108,6 +107,7 @@ class BaseTest( unittest.TestCase ):
|
||||
""" Branch test: old API 0.0.x what should be removed """
|
||||
self.assertFalse( hasattr(pykd, 'dbgModuleClass') )
|
||||
self.assertFalse( hasattr(pykd, 'debugEvent') )
|
||||
self.assertFalse( hasattr(pykd, 'findModule') )
|
||||
self.assertFalse( hasattr(pykd, 'windbgIn') )
|
||||
self.assertFalse( hasattr(pykd, 'windbgOut') )
|
||||
|
||||
|
@ -33,18 +33,26 @@ class ModuleTest( unittest.TestCase ):
|
||||
|
||||
def testFindModule( self ):
|
||||
|
||||
try: pykd.findModule( target.module.begin() - 0x10 )
|
||||
except pykd.BaseException: pass
|
||||
#self.assertRaises( pykd.BaseException, pykd.findModule, target.module.begin() - 0x10 )
|
||||
try:
|
||||
pykd.loadModule( target.module.begin() - 0x10 )
|
||||
self.assertTrue( False )
|
||||
except pykd.BaseException:
|
||||
self.assertTrue( True )
|
||||
|
||||
self.assertNotEqual( None, pykd.findModule( target.module.begin() ) )
|
||||
self.assertNotEqual( None, pykd.findModule( target.module.begin() + 0x10) )
|
||||
self.assertNotEqual( None, pykd.loadModule( target.module.begin() ) )
|
||||
self.assertNotEqual( None, pykd.loadModule( target.module.begin() + 0x10) )
|
||||
|
||||
try: pykd.findModule( target.module.end() )
|
||||
except pykd.BaseException: pass
|
||||
try:
|
||||
pykd.loadModule( target.module.end() )
|
||||
self.assertTrue( False )
|
||||
except pykd.BaseException:
|
||||
self.assertTrue( True )
|
||||
|
||||
try: pykd.findModule( target.module.end() + 0x10)
|
||||
except pykd.BaseException: pass
|
||||
try:
|
||||
pykd.loadModule( target.module.end() + 0x10 )
|
||||
self.assertTrue( False )
|
||||
except pykd.BaseException:
|
||||
self.assertTrue( True )
|
||||
|
||||
def testSymbol( self ):
|
||||
self.assertEqual( target.module.rva("FuncWithName0"), target.module.offset("FuncWithName0") - target.module.begin() )
|
||||
|
@ -58,4 +58,4 @@ if __name__ == "__main__":
|
||||
|
||||
unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run( suite )
|
||||
|
||||
#a = raw_input("\npress return\n")
|
||||
a = raw_input("\npress return\n")
|
Loading…
Reference in New Issue
Block a user