[0.3.x] added : getLastEvent getLastException routines

git-svn-id: https://pykd.svn.codeplex.com/svn@87129 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2014-01-24 08:44:13 +00:00 committed by Mikhail I. Izmestev
parent 9f6cd6996f
commit 04d1224621
3 changed files with 34 additions and 17 deletions

View File

@ -239,6 +239,7 @@
<ClInclude Include="pydbgeng.h" /> <ClInclude Include="pydbgeng.h" />
<ClInclude Include="pydbgio.h" /> <ClInclude Include="pydbgio.h" />
<ClInclude Include="pyeventhandler.h" /> <ClInclude Include="pyeventhandler.h" />
<ClInclude Include="pyevents.h" />
<ClInclude Include="pykdver.h" /> <ClInclude Include="pykdver.h" />
<ClInclude Include="pymemaccess.h" /> <ClInclude Include="pymemaccess.h" />
<ClInclude Include="pymodule.h" /> <ClInclude Include="pymodule.h" />

View File

@ -72,6 +72,9 @@
<ClInclude Include="pydisasm.h"> <ClInclude Include="pydisasm.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="pyevents.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="stdafx.cpp"> <ClCompile Include="stdafx.cpp">

View File

@ -14,6 +14,7 @@
#include "pydbgeng.h" #include "pydbgeng.h"
#include "pydbgio.h" #include "pydbgio.h"
#include "pydisasm.h" #include "pydisasm.h"
#include "pyevents.h"
#include "pyeventhandler.h" #include "pyeventhandler.h"
#include "pymemaccess.h" #include "pymemaccess.h"
#include "pymodule.h" #include "pymodule.h"
@ -381,6 +382,14 @@ BOOST_PYTHON_MODULE( pykd )
python::def( "setImplicitThread", pykd::setImplicitThread, python::def( "setImplicitThread", pykd::setImplicitThread,
"Set implicit thread" ); "Set implicit thread" );
// events
python::def("getLastEvent", pykd::getLastEvent,
"Get last debug event information");
python::def("getLastException", pykd::getLastException,
"Get last exception information");
// // symbol path // // symbol path
// python::def( "getSymbolPath", &getSymbolPath, "Returns current symbol path"); // python::def( "getSymbolPath", &getSymbolPath, "Returns current symbol path");
// python::def( "setSymbolPath", &setSymbolPath, "Set current symbol path"); // python::def( "setSymbolPath", &setSymbolPath, "Set current symbol path");
@ -681,24 +690,28 @@ BOOST_PYTHON_MODULE( pykd )
.def( "__str__", pykd::printExceptionInfo, .def( "__str__", pykd::printExceptionInfo,
"Return object as a string"); "Return object as a string");
// python::enum_<EVENT_TYPE>("eventType", "Type of debug event") python::enum_<kdlib::EventType>("eventType", "Type of debug event")
// .value("Breakpoint", EventTypeBreakpoint) .value("Breakpoint", kdlib::EventTypeBreakpoint)
// .value("Exception", EventTypeException) .value("Exception", kdlib::EventTypeException)
// .value("CreateThread", EventTypeCreateThread) .value("CreateThread", kdlib::EventTypeCreateThread)
// .value("ExitThread", EventTypeExitThread) .value("ExitThread", kdlib::EventTypeExitThread)
// .value("CreateProcess", EventTypeCreateProcess) .value("CreateProcess", kdlib::EventTypeCreateProcess)
// .value("ExitProcess", EventTypeExitProcess) .value("ExitProcess", kdlib::EventTypeExitProcess)
// .value("LoadModule", EventTypeLoadModule) .value("LoadModule", kdlib::EventTypeLoadModule)
// .value("UnloadModule", EventTypeUnloadModule) .value("UnloadModule", kdlib::EventTypeUnloadModule)
// .value("SystemError", EventTypeSystemError) .value("SystemError", kdlib::EventTypeSystemError)
// .value("SessionStatus", EventTypeSessionStatus) .value("SessionStatus", kdlib::EventTypeSessionStatus)
// .value("ChangeDebuggeeState", EventTypeChangeDebuggeeState) .value("ChangeDebuggeeState", kdlib::EventTypeChangeDebuggeeState)
// .value("ChangeEngineState", EventTypeChangeEngineState) .value("ChangeEngineState", kdlib::EventTypeChangeEngineState)
// .value("ChangeSymbolState", EventTypeChangeSymbolState) .value("ChangeSymbolState", kdlib::EventTypeChangeSymbolState)
// .export_values(); .export_values();
python::class_<pykd::DebugEvent>("debugEvent", "Debug evemt descriptions", python::no_init)
.def_readonly("type", &DebugEvent::eventType)
.def_readonly("process", &DebugEvent::process)
.def_readonly("thread", &DebugEvent::thread)
;
// python::def( "lastEvent", &getLastEventType,
// "Return type of last event: eventType" );
// python::def( "lastException", &getLastExceptionInfo, // python::def( "lastException", &getLastExceptionInfo,
// "Return data of last exception event: exceptionInfo" ); // "Return data of last exception event: exceptionInfo" );
// python::def( "bugCheckData", &pysupport::getBugCheckData, // python::def( "bugCheckData", &pysupport::getBugCheckData,