diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index f26870e..746af7a 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -562,14 +562,18 @@ BOOST_PYTHON_MODULE( pykd ) "Return number of threads for this process" ) .def("getThread", TargetProcessAdapter::getThreadByIndex, "Return thread by its index" ) - .def("getThreadById", TargetProcessAdapter::getThreadById, + .def("getThreadById", TargetProcessAdapter::getThreadById, "Return thread by its index") .def("currentThread", TargetProcessAdapter::getCurrentThread, "Return current thread" ) .def("getNumberBreakpoints", TargetProcessAdapter::getNumberBreakpoints, "Return number of breakpoints for this process" ) - .def("breakpoint", TargetProcessAdapter::getBreakpointByIndex, python::return_value_policy(), + .def("getBreakpoint", TargetProcessAdapter::getBreakpointByIndex, python::return_value_policy(), "Return a breakpoint by it's index" ) + .def("getNumberModules", TargetProcessAdapter::getNumberModules, + "Return number of modules for this process" ) + .def("getModule", TargetProcessAdapter::getModuleByIndex, + "Return a module object by it's index" ) ; python::class_("targetThread", "Class representing process in the target system", python::no_init ) diff --git a/pykd/pyprocess.h b/pykd/pyprocess.h index 783d47f..aad4a57 100644 --- a/pykd/pyprocess.h +++ b/pykd/pyprocess.h @@ -192,6 +192,18 @@ struct TargetProcessAdapter { AutoRestorePyState pystate; return process.isCurrent(); } + + static unsigned long getNumberModules(kdlib::TargetProcess& process) + { + AutoRestorePyState pystate; + return process.getNumberModules(); + } + + static kdlib::ModulePtr getModuleByIndex(kdlib::TargetProcess& process, unsigned long index) + { + AutoRestorePyState pystate; + return process.getModuleByIndex(index); + } };