[0.3.x] added : getNumberBreakpoint, breakpoints methods

git-svn-id: https://pykd.svn.codeplex.com/svn@89668 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\ussrhero_cp 2015-01-21 20:48:46 +00:00 committed by Mikhail I. Izmestev
parent ebdd06f6bd
commit 4aeefd3ec5
4 changed files with 29 additions and 1 deletions

View File

@ -182,6 +182,7 @@
<ClInclude Include="pykdver.h" /> <ClInclude Include="pykdver.h" />
<ClInclude Include="pymemaccess.h" /> <ClInclude Include="pymemaccess.h" />
<ClInclude Include="pymodule.h" /> <ClInclude Include="pymodule.h" />
<ClInclude Include="pyprocess.h" />
<ClInclude Include="pysymengine.h" /> <ClInclude Include="pysymengine.h" />
<ClInclude Include="pythreadstate.h" /> <ClInclude Include="pythreadstate.h" />
<ClInclude Include="pytypedvar.h" /> <ClInclude Include="pytypedvar.h" />

View File

@ -75,6 +75,9 @@
<ClInclude Include="pyevents.h"> <ClInclude Include="pyevents.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="pyprocess.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="stdafx.cpp"> <ClCompile Include="stdafx.cpp">

View File

@ -519,6 +519,10 @@ BOOST_PYTHON_MODULE( pykd )
"Return thread by its index" ) "Return thread by its index" )
.def("currentThread", TargetProcessAdapter::getCurrentThread, .def("currentThread", TargetProcessAdapter::getCurrentThread,
"Return current thread" ) "Return current thread" )
.def("getNumberBreakpoints", TargetProcessAdapter::getNumberBreakpoints,
"Return number of breakpoints for this process" )
.def("breakpoint", TargetProcessAdapter::getBreakpointByIndex,
"Return a breakpoint by it's index" )
; ;
python::class_<kdlib::TargetThread, kdlib::TargetThreadPtr, boost::noncopyable>("targetThread", "Class representing process in the target system", python::no_init ) python::class_<kdlib::TargetThread, kdlib::TargetThreadPtr, boost::noncopyable>("targetThread", "Class representing process in the target system", python::no_init )
@ -528,6 +532,8 @@ BOOST_PYTHON_MODULE( pykd )
"Return TEB address" ) "Return TEB address" )
.def("setCurrent", TargetThreadAdapter::setCurrent, .def("setCurrent", TargetThreadAdapter::setCurrent,
"Set this thread current") "Set this thread current")
.def("isCurrent", TargetThreadAdapter::isCurrent,
"Check if this thread is current")
; ;
python::class_<kdlib::Module, kdlib::ModulePtr, python::bases<kdlib::NumBehavior>, boost::noncopyable>("module", "Class representing executable module", python::no_init ) python::class_<kdlib::Module, kdlib::ModulePtr, python::bases<kdlib::NumBehavior>, boost::noncopyable>("module", "Class representing executable module", python::no_init )

View File

@ -61,6 +61,18 @@ struct TargetProcessAdapter {
AutoRestorePyState pystate; AutoRestorePyState pystate;
return process.getCurrentThread(); return process.getCurrentThread();
} }
static unsigned long getNumberBreakpoints(kdlib::TargetProcess& process)
{
AutoRestorePyState pystate;
return process.getNumberBreakpoints();
}
static kdlib::BreakpointPtr getBreakpointByIndex(kdlib::TargetProcess& process, unsigned long index)
{
AutoRestorePyState pystate;
return process.getBreakpoint(index);
}
}; };
@ -83,6 +95,12 @@ struct TargetThreadAdapter {
AutoRestorePyState pystate; AutoRestorePyState pystate;
return thread.setCurrent(); return thread.setCurrent();
} }
static bool isCurrent(kdlib::TargetThread& thread)
{
AutoRestorePyState pystate;
return thread.isCurrent();
}
}; };
} // pykd namespace } // pykd namespace