mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 19:53:22 +08:00
[0.2.x] + bugCheckData
git-svn-id: https://pykd.svn.codeplex.com/svn@82621 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
0c6d91692d
commit
5c7857a718
@ -132,6 +132,17 @@ enum EVENT_TYPE {
|
||||
EVENT_TYPE getLastEventType();
|
||||
ExceptionInfoPtr getLastExceptionInfo();
|
||||
|
||||
|
||||
struct BUG_CHECK_DATA
|
||||
{
|
||||
ULONG code;
|
||||
ULONG64 arg1;
|
||||
ULONG64 arg2;
|
||||
ULONG64 arg3;
|
||||
ULONG64 arg4;
|
||||
};
|
||||
void readBugCheckData(BUG_CHECK_DATA &bugCheckData);
|
||||
|
||||
void eventRegisterCallbacks( const DEBUG_EVENT_CALLBACK *callbacks );
|
||||
void eventRemoveCallbacks( const DEBUG_EVENT_CALLBACK *callbacks );
|
||||
|
||||
|
@ -549,8 +549,13 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
.value("ChangeSymbolState", EventTypeChangeSymbolState)
|
||||
.export_values();
|
||||
|
||||
python::def( "lastEvent", &getLastEventType, "Return type of last event: eventType" );
|
||||
python::def( "lastException", &getLastExceptionInfo, "Return data of last exception event: exceptionInfo" );
|
||||
python::def( "lastEvent", &getLastEventType,
|
||||
"Return type of last event: eventType" );
|
||||
python::def( "lastException", &getLastExceptionInfo,
|
||||
"Return data of last exception event: exceptionInfo" );
|
||||
python::def( "bugCheckData", &pysupport::getBugCheckData,
|
||||
"Function reads the kernel bug check code and related parameters\n"
|
||||
"And return tuple: (code, arg1, arg2, arg3, arg4)" );
|
||||
|
||||
python::class_<Disasm>("disasm", "Class disassemble a processor instructions" )
|
||||
.def( python::init<>( "constructor" ) )
|
||||
|
@ -25,6 +25,13 @@ python::list getProcessThreads()
|
||||
return threadsLst;
|
||||
}
|
||||
|
||||
python::tuple getBugCheckData()
|
||||
{
|
||||
BUG_CHECK_DATA bugCheckData;
|
||||
readBugCheckData(bugCheckData);
|
||||
return python::make_tuple(bugCheckData.code, bugCheckData.arg1, bugCheckData.arg2, bugCheckData.arg3, bugCheckData.arg4);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
} } //pykd::support namespace end
|
@ -9,6 +9,8 @@ namespace pysupport {
|
||||
|
||||
python::list getProcessThreads();
|
||||
|
||||
python::tuple getBugCheckData();
|
||||
|
||||
} } //pykd::support namespace end
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -91,6 +91,19 @@ ExceptionInfoPtr getLastExceptionInfo()
|
||||
);
|
||||
}
|
||||
|
||||
void readBugCheckData(BUG_CHECK_DATA &bugCheckData)
|
||||
{
|
||||
HRESULT hres =
|
||||
g_dbgEng->control->ReadBugCheckData(
|
||||
&bugCheckData.code,
|
||||
&bugCheckData.arg1,
|
||||
&bugCheckData.arg2,
|
||||
&bugCheckData.arg3,
|
||||
&bugCheckData.arg4);
|
||||
if (S_OK != hres)
|
||||
throw DbgException("IDebugControl::GetLastEventInformation", hres);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user