[0.3.x] added : getLocalProcesses routine ( Return list of runnng processes on the host system )

git-svn-id: https://pykd.svn.codeplex.com/svn@90880 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\ussrhero_cp 2015-12-07 20:35:05 +00:00 committed by Mikhail I. Izmestev
parent fe84574b79
commit b58e7e0b81
3 changed files with 23 additions and 0 deletions

View File

@ -143,6 +143,26 @@ python::list getTargetProcesses()
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
python::list getLocalProcesses()
{
std::vector<kdlib::LiveProcessInfo> processInfoLst;
do {
AutoRestorePyState pystate;
kdlib::getLiveProcessesList(processInfoLst);
} while(false);
python::list lst;
for ( unsigned long i = 0; i < processInfoLst.size(); ++i)
lst.append( python::make_tuple( processInfoLst[i].pid, processInfoLst[i].name, processInfoLst[i].user ) );
return lst;
}
///////////////////////////////////////////////////////////////////////////////
python::tuple getBugCheckData() python::tuple getBugCheckData()
{ {
kdlib::SystemCrashInfo crashInfo = {}; kdlib::SystemCrashInfo crashInfo = {};

View File

@ -274,6 +274,7 @@ inline kdlib::MEMOFFSET_64 getImplicitProcessOffset()
python::list getProcessThreads(); python::list getProcessThreads();
python::list getTargetProcesses(); python::list getTargetProcesses();
python::list getLocalProcesses();
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -165,6 +165,8 @@ BOOST_PYTHON_MODULE( pykd )
"Check if script works in windbg context" ); "Check if script works in windbg context" );
python::def( "writeDump", pykd::writeDump, python::def( "writeDump", pykd::writeDump,
"Create memory dump file" ); "Create memory dump file" );
python::def( "getLocalProcesses", pykd::getLocalProcesses,
"Return list of runnng processes on the host system" );
python::def( "breakin", pykd::targetBreak, python::def( "breakin", pykd::targetBreak,
"Break into debugger" ); "Break into debugger" );