mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 04:13:22 +08:00
[0.3.x] added : targetSystem.getId method
git-svn-id: https://pykd.svn.codeplex.com/svn@90240 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
58e04d9b39
commit
6c05d847de
@ -516,8 +516,12 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
"Return current target system").staticmethod("getCurrent")
|
"Return current target system").staticmethod("getCurrent")
|
||||||
.def("getSystem", TargetSystemAdapter::getSystem,
|
.def("getSystem", TargetSystemAdapter::getSystem,
|
||||||
"Return target system by index").staticmethod("getSystem")
|
"Return target system by index").staticmethod("getSystem")
|
||||||
|
.def("getSystemById", TargetSystemAdapter::getSystemById,
|
||||||
|
"Return target system by id").staticmethod("getSystemById")
|
||||||
.add_property("desc", TargetSystemAdapter::getDescription,
|
.add_property("desc", TargetSystemAdapter::getDescription,
|
||||||
"Retunr target system description")
|
"Retunr target system description")
|
||||||
|
.add_property("id", TargetSystemAdapter::getId,
|
||||||
|
"Return id of the target system" )
|
||||||
.def("isDumpAnalyzing", TargetSystemAdapter::isDumpAnalyzing,
|
.def("isDumpAnalyzing", TargetSystemAdapter::isDumpAnalyzing,
|
||||||
"Check if it is a dump analyzing ( not living debuggee )")
|
"Check if it is a dump analyzing ( not living debuggee )")
|
||||||
.def("isKernelDebugging", TargetSystemAdapter::isKernelDebugging,
|
.def("isKernelDebugging", TargetSystemAdapter::isKernelDebugging,
|
||||||
@ -541,8 +545,12 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
"Return a current process" ).staticmethod("getCurrent")
|
"Return a current process" ).staticmethod("getCurrent")
|
||||||
.def("getProcess", TargetProcessAdapter::getProcess,
|
.def("getProcess", TargetProcessAdapter::getProcess,
|
||||||
"Return process by index").staticmethod("getProcess")
|
"Return process by index").staticmethod("getProcess")
|
||||||
|
.def("getProcessById", TargetProcessAdapter::getProcessById,
|
||||||
|
"Return process by id").staticmethod("getProcessById")
|
||||||
.add_property("systemID", TargetProcessAdapter::getSystemId,
|
.add_property("systemID", TargetProcessAdapter::getSystemId,
|
||||||
"Retrun system process ID ( PID )" )
|
"Retrun system process ID ( PID )" )
|
||||||
|
.add_property("id", TargetProcessAdapter::getId,
|
||||||
|
"Return process id")
|
||||||
.add_property("peb", TargetProcessAdapter::getPebOffset,
|
.add_property("peb", TargetProcessAdapter::getPebOffset,
|
||||||
"Return PEB address" )
|
"Return PEB address" )
|
||||||
.add_property("exeName", TargetProcessAdapter::getExeName,
|
.add_property("exeName", TargetProcessAdapter::getExeName,
|
||||||
@ -562,6 +570,16 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
;
|
;
|
||||||
|
|
||||||
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 )
|
||||||
|
.def("getNumber", TargetThreadAdapter::getNumberThreads,
|
||||||
|
"Return number of threads").staticmethod("getNumber")
|
||||||
|
.def("getCurrent", TargetThreadAdapter::getCurrent,
|
||||||
|
"Return a current thread").staticmethod("getCurrent")
|
||||||
|
.def("getThread", TargetThreadAdapter::getThread,
|
||||||
|
"Return thread by index").staticmethod("getThread")
|
||||||
|
.def("getThreadById", TargetThreadAdapter::getThreadById,
|
||||||
|
"Return process by id").staticmethod("getThreadById")
|
||||||
|
.add_property("id", TargetThreadAdapter::getId,
|
||||||
|
"Return thread id")
|
||||||
.add_property("systemID", TargetThreadAdapter::getSystemId,
|
.add_property("systemID", TargetThreadAdapter::getSystemId,
|
||||||
"Retrun system thread ID ( TID )" )
|
"Retrun system thread ID ( TID )" )
|
||||||
.add_property("teb", TargetThreadAdapter::getTebOffset,
|
.add_property("teb", TargetThreadAdapter::getTebOffset,
|
||||||
|
@ -27,12 +27,24 @@ struct TargetSystemAdapter {
|
|||||||
return kdlib::TargetSystem::getByIndex(index);
|
return kdlib::TargetSystem::getByIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static kdlib::TargetSystemPtr getSystemById(kdlib::SYSTEM_DEBUG_ID id)
|
||||||
|
{
|
||||||
|
AutoRestorePyState pystate;
|
||||||
|
return kdlib::TargetSystem::getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
static std::wstring getDescription(kdlib::TargetSystem& system)
|
static std::wstring getDescription(kdlib::TargetSystem& system)
|
||||||
{
|
{
|
||||||
AutoRestorePyState pystate;
|
AutoRestorePyState pystate;
|
||||||
return system.getDescription();
|
return system.getDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static kdlib::SYSTEM_DEBUG_ID getId(kdlib::TargetSystem& system)
|
||||||
|
{
|
||||||
|
AutoRestorePyState pystate;
|
||||||
|
return system.getId();
|
||||||
|
}
|
||||||
|
|
||||||
static bool isDumpAnalyzing(kdlib::TargetSystem& system)
|
static bool isDumpAnalyzing(kdlib::TargetSystem& system)
|
||||||
{
|
{
|
||||||
AutoRestorePyState pystate;
|
AutoRestorePyState pystate;
|
||||||
@ -91,6 +103,12 @@ struct TargetProcessAdapter {
|
|||||||
return kdlib::TargetProcess::getByIndex(index);
|
return kdlib::TargetProcess::getByIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static kdlib::TargetProcessPtr getProcessById(kdlib::PROCESS_DEBUG_ID id)
|
||||||
|
{
|
||||||
|
AutoRestorePyState pystate;
|
||||||
|
return kdlib::TargetProcess::getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned long getNumberProcesses()
|
static unsigned long getNumberProcesses()
|
||||||
{
|
{
|
||||||
AutoRestorePyState pystate;
|
AutoRestorePyState pystate;
|
||||||
@ -103,6 +121,12 @@ struct TargetProcessAdapter {
|
|||||||
return process.getSystemId();
|
return process.getSystemId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static kdlib::PROCESS_DEBUG_ID getId(kdlib::TargetProcess& process)
|
||||||
|
{
|
||||||
|
AutoRestorePyState pystate;
|
||||||
|
return process.getId();
|
||||||
|
}
|
||||||
|
|
||||||
static kdlib::MEMOFFSET_64 getPebOffset(kdlib::TargetProcess& process)
|
static kdlib::MEMOFFSET_64 getPebOffset(kdlib::TargetProcess& process)
|
||||||
{
|
{
|
||||||
AutoRestorePyState pystate;
|
AutoRestorePyState pystate;
|
||||||
@ -161,6 +185,36 @@ struct TargetProcessAdapter {
|
|||||||
|
|
||||||
struct TargetThreadAdapter {
|
struct TargetThreadAdapter {
|
||||||
|
|
||||||
|
static unsigned long getNumberThreads()
|
||||||
|
{
|
||||||
|
AutoRestorePyState pystate;
|
||||||
|
return kdlib::TargetThread::getNumber();
|
||||||
|
}
|
||||||
|
|
||||||
|
static kdlib::TargetThreadPtr getCurrent()
|
||||||
|
{
|
||||||
|
AutoRestorePyState pystate;
|
||||||
|
return kdlib::TargetThread::getCurrent();
|
||||||
|
}
|
||||||
|
|
||||||
|
static kdlib::TargetThreadPtr getThread(unsigned long index)
|
||||||
|
{
|
||||||
|
AutoRestorePyState pystate;
|
||||||
|
return kdlib::TargetThread::getByIndex(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
static kdlib::TargetThreadPtr getThreadById(kdlib::THREAD_DEBUG_ID id)
|
||||||
|
{
|
||||||
|
AutoRestorePyState pystate;
|
||||||
|
return kdlib::TargetThread::getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
static kdlib::THREAD_DEBUG_ID getId(kdlib::TargetThread& thread)
|
||||||
|
{
|
||||||
|
AutoRestorePyState pystate;
|
||||||
|
return thread.getId();
|
||||||
|
}
|
||||||
|
|
||||||
static kdlib::THREAD_ID getSystemId(kdlib::TargetThread& thread )
|
static kdlib::THREAD_ID getSystemId(kdlib::TargetThread& thread )
|
||||||
{
|
{
|
||||||
AutoRestorePyState pystate;
|
AutoRestorePyState pystate;
|
||||||
|
Loading…
Reference in New Issue
Block a user