From 5d30d67978537a8e4475b44aa510a4754b5983a7 Mon Sep 17 00:00:00 2001 From: ussrhero Date: Mon, 5 Mar 2018 12:44:35 +0300 Subject: [PATCH] added getDebugOptions routine (returns debug options) added changeDebuOptions routine (change debug options) --- pykd/pydbgeng.h | 14 ++++++++++++++ pykd/pykdver.h | 2 +- pykd/pymod.cpp | 26 ++++++++++++++++---------- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/pykd/pydbgeng.h b/pykd/pydbgeng.h index f94a06f..9c0ee19 100644 --- a/pykd/pydbgeng.h +++ b/pykd/pydbgeng.h @@ -119,6 +119,20 @@ python::object debugCommand( const std::wstring &command, bool suppressOutput = return python::object(); } +inline +kdlib::DebugOptionsSet getDebugOptions() +{ + AutoRestorePyState pystate; + return kdlib::getDebugOptions(); +} + +inline +void changeDebugOptions(kdlib::DebugOptionsSet &addOptions, kdlib::DebugOptionsSet &removeOptions) +{ + AutoRestorePyState pystate; + kdlib::changeDebugOptions(addOptions, removeOptions); +} + /////////////////////////////////////////////////////////////////////////////// // processes end threads diff --git a/pykd/pykdver.h b/pykd/pykdver.h index 59e18f8..3559c32 100644 --- a/pykd/pykdver.h +++ b/pykd/pykdver.h @@ -2,7 +2,7 @@ #define PYKD_VERSION_MAJOR 0 #define PYKD_VERSION_MINOR 3 #define PYKD_VERSION_SUBVERSION 3 -#define PYKD_VERSION_BUILDNO 2 +#define PYKD_VERSION_BUILDNO 3 #define __VER_STR2__(x) #x #define __VER_STR1__(x) __VER_STR2__(x) diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index 624168a..d265da9 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -186,6 +186,11 @@ BOOST_PYTHON_MODULE( pykd ) "Create memory dump file" ); python::def( "getLocalProcesses", pykd::getLocalProcesses, "Return list of runnng processes on the host system" ); + python::def( "getDebugOptions", pykd::getDebugOptions, + "Return debug options" ); + python::def( "changeDebugOptions", pykd::changeDebugOptions, + "Change debug options" ); + python::def( "breakin", pykd::targetBreak, "Break into debugger" ); @@ -1360,16 +1365,17 @@ BOOST_PYTHON_MODULE( pykd ) .def("__str__", pykd::printSyntheticSymbol, "Return object as a string"); - //python::class_("dataAccessor", - // "class for abstract representation of data storage",python::no_init) - // .def("readByte", &pykd::DataAccessor::readByte) - // ; - - //python::class_("objectAccessor", - // "class for data access to python objects", python::no_init) - // .def( python::init() ) - // //.def("readByte", &pykd::ListDataAccessor::readByte, "") - // ; + python::enum_("debugOptions", "Debug options") + .value("InitialBreak", kdlib::InitialBreak) + .value("FinalBreak", kdlib::FinalBreak) + .value("PreferDml", kdlib::PreferDml) + ; + + python::enum_("breakpointAccess", "Breakpoint access types") + .value("Read", kdlib::Read) + .value("Write", kdlib::Write) + .value("Execute", kdlib::Execute) + ; // C++ exception translation to python pykd::registerExceptions();