mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-22 05:13:22 +08:00
[0.3.x] added : dbgCommand routine
git-svn-id: https://pykd.svn.codeplex.com/svn@84232 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
6d0bb6e9ab
commit
49e4558428
@ -107,6 +107,32 @@ void loadDump( const std::wstring &fileName )
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::wstring debugCommand( const std::wstring &command )
|
||||
{
|
||||
PyThreadState* state = PyEval_SaveThread();
|
||||
|
||||
std::wstring outstr = kdlib::debugCommand(command);
|
||||
|
||||
PyEval_RestoreThread( state );
|
||||
|
||||
return outstr;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
unsigned long long evaluate( const std::wstring &expression )
|
||||
{
|
||||
PyThreadState* state = PyEval_SaveThread();
|
||||
|
||||
unsigned long long result = kdlib::evaluate(expression);
|
||||
|
||||
PyEval_RestoreThread( state );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
python::tuple getSourceLine( kdlib::MEMOFFSET_64 offset )
|
||||
{
|
||||
std::wstring fileName;
|
||||
|
@ -18,6 +18,9 @@ kdlib::PROCESS_DEBUG_ID startProcess( const std::wstring &processName );
|
||||
kdlib::PROCESS_DEBUG_ID attachProcess( kdlib::PROCESS_ID pid );
|
||||
void loadDump( const std::wstring &fileName );
|
||||
|
||||
std::wstring debugCommand( const std::wstring &command );
|
||||
unsigned long long evaluate( const std::wstring &expression );
|
||||
|
||||
python::tuple getSourceLine( kdlib::MEMOFFSET_64 offset = 0 );
|
||||
|
||||
python::tuple findSymbolAndDisp( ULONG64 offset );
|
||||
|
@ -104,10 +104,10 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
|
||||
python::def( "breakin", &targetBreak,
|
||||
"Break into debugger" );
|
||||
//python::def( "expr", &evaluate,
|
||||
// "Evaluate windbg expression" );
|
||||
//python::def( "dbgCommand", &debugCommand,
|
||||
// "Run a debugger's command and return it's result as a string" );
|
||||
python::def( "expr", &evaluate,
|
||||
"Evaluate windbg expression" );
|
||||
python::def( "dbgCommand", &debugCommand,
|
||||
"Run a debugger's command and return it's result as a string" );
|
||||
python::def( "go", &targetGo,
|
||||
"Go debugging" );
|
||||
python::def( "step", &targetStep,
|
||||
|
Loading…
Reference in New Issue
Block a user