2012-12-21 22:34:47 +08:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "pysupport.h"
|
|
|
|
|
|
|
|
#include "dbgengine.h"
|
2013-03-12 16:56:07 +08:00
|
|
|
#include "typeinfo.h"
|
2012-12-21 22:34:47 +08:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
namespace pykd {
|
|
|
|
namespace pysupport {
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
python::list getProcessThreads()
|
|
|
|
{
|
|
|
|
std::vector<ULONG64> threads;
|
|
|
|
getAllProcessThreads( threads );
|
|
|
|
|
|
|
|
python::list threadsLst;
|
|
|
|
|
|
|
|
std::vector<ULONG64>::iterator it;
|
|
|
|
for ( it = threads.begin(); it != threads.end(); ++it )
|
|
|
|
threadsLst.append( *it );
|
|
|
|
|
|
|
|
return threadsLst;
|
|
|
|
}
|
|
|
|
|
2013-02-12 23:49:34 +08:00
|
|
|
python::tuple getBugCheckData()
|
|
|
|
{
|
|
|
|
BUG_CHECK_DATA bugCheckData;
|
|
|
|
readBugCheckData(bugCheckData);
|
|
|
|
return python::make_tuple(bugCheckData.code, bugCheckData.arg1, bugCheckData.arg2, bugCheckData.arg3, bugCheckData.arg4);
|
|
|
|
}
|
|
|
|
|
2013-03-12 16:56:07 +08:00
|
|
|
python::tuple findSymbolAndDisp( ULONG64 offset )
|
|
|
|
{
|
|
|
|
std::string symbolName;
|
|
|
|
LONG displacement;
|
|
|
|
|
|
|
|
pykd::TypeInfo::findSymbolAndDisp( offset, symbolName, displacement );
|
|
|
|
|
|
|
|
return python::make_tuple(symbolName,displacement);
|
|
|
|
}
|
|
|
|
|
|
|
|
python::tuple moduleFindSymbolAndDisp( pykd::Module &module, ULONG64 offset )
|
|
|
|
{
|
|
|
|
std::string symbolName;
|
|
|
|
LONG displacement;
|
|
|
|
|
|
|
|
module.getSymbolAndDispByVa( offset, symbolName, displacement );
|
|
|
|
|
|
|
|
return python::make_tuple(symbolName,displacement);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-12-21 22:34:47 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
} } //pykd::support namespace end
|