[0.3.x] added : ProcessDebugOptions enumerator

git-svn-id: https://pykd.svn.codeplex.com/svn@90973 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2016-03-31 14:51:24 +00:00 committed by Mikhail I. Izmestev
parent c9f7ad5e1e
commit aa872e196f
3 changed files with 20 additions and 8 deletions

View File

@ -12,17 +12,17 @@ namespace pykd {
///////////////////////////////////////////////////////////////////////////////
inline
kdlib::PROCESS_DEBUG_ID startProcess( const std::wstring &processName, bool debugChildren = false )
kdlib::PROCESS_DEBUG_ID startProcess(const std::wstring &processName, const kdlib::ProcessDebugFlags& flags = kdlib::ProcessDebugDefault)
{
AutoRestorePyState pystate;
return kdlib::startProcess(processName, debugChildren);
return kdlib::startProcess(processName, flags);
}
inline
kdlib::PROCESS_DEBUG_ID attachProcess( kdlib::PROCESS_ID pid )
kdlib::PROCESS_DEBUG_ID attachProcess(kdlib::PROCESS_ID pid, const kdlib::ProcessDebugFlags& flags = kdlib::ProcessDebugDefault)
{
AutoRestorePyState pystate;
return kdlib::attachProcess(pid);
return kdlib::attachProcess(pid, flags);
}
inline

View File

@ -36,6 +36,7 @@ static const std::string pykdVersion = PYKD_VERSION_BUILD_STR
BOOST_PYTHON_FUNCTION_OVERLOADS( startProcess_, pykd::startProcess, 1, 2 );
BOOST_PYTHON_FUNCTION_OVERLOADS( attachProcess_, pykd::attachProcess, 1, 2);
BOOST_PYTHON_FUNCTION_OVERLOADS( detachProcess_, pykd::detachProcess, 0, 1 );
BOOST_PYTHON_FUNCTION_OVERLOADS( terminateProcess_, pykd::terminateProcess, 0, 1 );
BOOST_PYTHON_FUNCTION_OVERLOADS(closeDump_, pykd::closeDump, 0, 1);
@ -138,10 +139,10 @@ BOOST_PYTHON_MODULE( pykd )
// Manage debug target
python::def( "startProcess", pykd::startProcess, startProcess_( boost::python::args( "commandline", "debugChildren" ),
python::def( "startProcess", pykd::startProcess, startProcess_( boost::python::args( "commandline", "debugOptions"),
"Start process for debugging" ) );
python::def( "attachProcess", pykd::attachProcess,
"Attach debugger to a exsisting process" );
python::def("attachProcess", pykd::attachProcess, attachProcess_(boost::python::args("pid", "debugOptions"),
"Attach debugger to a exsisting process") );
python::def( "detachProcess", pykd::detachProcess, detachProcess_( boost::python::args( "id" ),
"Stop process debugging") );
python::def( "detachAllProcesses", pykd::detachAllProcesses,
@ -1094,6 +1095,14 @@ BOOST_PYTHON_MODULE( pykd )
.value("PageExecuteWriteCopy", kdlib::PageExecuteWriteCopy)
;
python::enum_<kdlib::ProcessDebugOptions>("ProcessDebugOptions", "Process debug option")
.value("BreakOnStart", kdlib::ProcessBreakOnStart)
.value("BreakOnStop", kdlib::ProcessBreakOnStop)
.value("DebugChildren", kdlib::ProcessDebugChildren)
.value("NoDebugHeap", kdlib::ProcessNoDebugHeap)
.value("Deafult", kdlib::ProcessDebugDefault)
;
python::class_<EventHandler, boost::noncopyable>(
"eventHandler", "Base class for overriding and handling debug notifications" )
.def( "onBreakpoint", &EventHandler::onBreakpoint,

View File

@ -81,11 +81,14 @@ if __name__ == "__main__":
print( "\nTesting PyKd ver. %s" % pykd.__version__ )
print( "Directory: %s" % os.path.dirname(pykd.__file__) )
import time
# time.sleep(30)
target.appPath = os.path.join( os.path.dirname(pykd.__file__), "targetapp.exe" )
target.moduleName = os.path.splitext(os.path.basename(target.appPath))[0]
unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run( getTestSuite() )
#unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run( getTestSuite("typeinfo.TypeInfoTest.testCompareWihNone") )
#unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run( getTestSuite("typedvar.TypedVarTest.testCompare") )
try: input = raw_input
except NameError: pass