[0.3.x] updated : targetBreak

git-svn-id: https://pykd.svn.codeplex.com/svn@83968 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2013-06-06 13:15:48 +00:00 committed by Mikhail I. Izmestev
parent 446a006a40
commit 89bb1c89ac
3 changed files with 54 additions and 43 deletions

View File

@ -19,6 +19,39 @@ void targetGo()
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void targetBreak()
{
PyThreadState* state = PyEval_SaveThread();
kdlib::targetBreak();
PyEval_RestoreThread( state );
}
///////////////////////////////////////////////////////////////////////////////
void targetStep()
{
PyThreadState* state = PyEval_SaveThread();
kdlib::targetStep();
PyEval_RestoreThread( state );
}
///////////////////////////////////////////////////////////////////////////////
void targetStepIn()
{
PyThreadState* state = PyEval_SaveThread();
kdlib::targetStepIn();
PyEval_RestoreThread( state );
}
///////////////////////////////////////////////////////////////////////////////
python::tuple getSourceLine( kdlib::MEMOFFSET_64 offset ) python::tuple getSourceLine( kdlib::MEMOFFSET_64 offset )
{ {
std::wstring fileName; std::wstring fileName;

View File

@ -10,6 +10,9 @@ namespace pykd {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void targetGo(); void targetGo();
void targetBreak();
void targetStep();
void targetStepIn();
python::tuple getSourceLine( kdlib::MEMOFFSET_64 offset = 0 ); python::tuple getSourceLine( kdlib::MEMOFFSET_64 offset = 0 );

View File

@ -14,32 +14,6 @@
using namespace pykd; using namespace pykd;
//
//#include "pykdver.h"
//
//#include "dbgengine.h"
//#include "symengine.h"
//
//#include "module.h"
//#include "variant.h"
//#include "dbgexcept.h"
//#include "dbgmem.h"
//#include "typeinfo.h"
//#include "customtypes.h"
//#include "typedvar.h"
//#include "cpureg.h"
//#include "disasm.h"
//#include "stkframe.h"
//#include "bpoint.h"
//#include "eventhandler.h"
//#include "pysupport.h"
//
//#include "win/dbgio.h"
//#include "win/windbg.h"
//
//using namespace pykd;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
static const std::string pykdVersion = PYKD_VERSION_BUILD_STR static const std::string pykdVersion = PYKD_VERSION_BUILD_STR
@ -49,9 +23,10 @@ static const std::string pykdVersion = PYKD_VERSION_BUILD_STR
; ;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
//
//BOOST_PYTHON_FUNCTION_OVERLOADS( detachProcess_, detachProcess, 0, 1 ); BOOST_PYTHON_FUNCTION_OVERLOADS( detachProcess_, kdlib::detachProcess, 0, 1 );
// BOOST_PYTHON_FUNCTION_OVERLOADS( terminateProcess_, kdlib::terminateProcess, 0, 1 );
BOOST_PYTHON_FUNCTION_OVERLOADS( dprint_, kdlib::dprint, 1, 2 ); BOOST_PYTHON_FUNCTION_OVERLOADS( dprint_, kdlib::dprint, 1, 2 );
BOOST_PYTHON_FUNCTION_OVERLOADS( dprintln_, kdlib::dprintln, 1, 2 ); BOOST_PYTHON_FUNCTION_OVERLOADS( dprintln_, kdlib::dprintln, 1, 2 );
@ -109,10 +84,10 @@ BOOST_PYTHON_MODULE( pykd )
"Start process for debugging" ); "Start process for debugging" );
python::def( "attachProcess", &kdlib::attachProcess, python::def( "attachProcess", &kdlib::attachProcess,
"Attach debugger to a exsisting process" ); "Attach debugger to a exsisting process" );
// python::def( "detachProcess", &detachProcess, detachProcess_( boost::python::args( "pid" ), python::def( "detachProcess", &kdlib::detachProcess, detachProcess_( boost::python::args( "pid" ),
// "Stop process debugging") ); "Stop process debugging") );
python::def( "killProcess", &kdlib::terminateProcess, python::def( "killProcess", &kdlib::terminateProcess, terminateProcess_( boost::python::args( "pid" ),
"Stop debugging and terminate current process" ); "Stop debugging and terminate current process" ) );
python::def( "loadDump", &kdlib::loadDump, python::def( "loadDump", &kdlib::loadDump,
"Load crash dump"); "Load crash dump");
python::def( "isDumpAnalyzing", &kdlib::isDumpAnalyzing, python::def( "isDumpAnalyzing", &kdlib::isDumpAnalyzing,
@ -124,18 +99,18 @@ BOOST_PYTHON_MODULE( pykd )
python::def( "writeDump", &kdlib::writeDump, python::def( "writeDump", &kdlib::writeDump,
"Create memory dump file" ); "Create memory dump file" );
// python::def( "breakin", &debugBreak, python::def( "breakin", &targetBreak,
// "Break into debugger" ); "Break into debugger" );
// python::def( "expr", &evaluate, //python::def( "expr", &evaluate,
// "Evaluate windbg expression" ); // "Evaluate windbg expression" );
// python::def( "dbgCommand", &debugCommand, //python::def( "dbgCommand", &debugCommand,
// "Run a debugger's command and return it's result as a string" ); // "Run a debugger's command and return it's result as a string" );
python::def( "go", &targetGo, python::def( "go", &targetGo,
"Go debugging" ); "Go debugging" );
// python::def( "step", &debugStep, python::def( "step", &targetStep,
// "The target is executing a single instruction or--if that instruction is a subroutine call--subroutine" ); "The target is executing a single instruction or--if that instruction is a subroutine call--subroutine" );
// python::def( "trace", &debugStepIn, python::def( "trace", &targetStepIn,
// "The target is executing a single instruction" ); "The target is executing a single instruction" );
// Debug output // Debug output
python::def( "dprint", &kdlib::dprint, dprint_( python::args( "str", "dml" ), python::def( "dprint", &kdlib::dprint, dprint_( python::args( "str", "dml" ),