[0.2.x] + bugCheckData

git-svn-id: https://pykd.svn.codeplex.com/svn@82621 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\EreTIk_cp 2013-02-12 15:49:34 +00:00 committed by Mikhail I. Izmestev
parent 0c6d91692d
commit 5c7857a718
5 changed files with 40 additions and 2 deletions

View File

@ -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 );

View File

@ -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" ) )

View File

@ -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

View File

@ -9,6 +9,8 @@ namespace pysupport {
python::list getProcessThreads();
python::tuple getBugCheckData();
} } //pykd::support namespace end
///////////////////////////////////////////////////////////////////////////////

View File

@ -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);
}
}
////////////////////////////////////////////////////////////////////////////////