From dfb935f3f8f6259a3d302b075dc91123a6a3e0e5 Mon Sep 17 00:00:00 2001 From: ussrhero Date: Mon, 16 Mar 2020 23:12:47 +0300 Subject: [PATCH] added : additional parameter for debugCommand routine to control an output mask --- pykd/pydbgeng.h | 4 ++-- pykd/pymod.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pykd/pydbgeng.h b/pykd/pydbgeng.h index 652fbe1..ef8ba9f 100644 --- a/pykd/pydbgeng.h +++ b/pykd/pydbgeng.h @@ -104,13 +104,13 @@ bool isKernelDebugging() inline -python::object debugCommand( const std::wstring &command, bool suppressOutput = true) +python::object debugCommand( const std::wstring &command, bool suppressOutput = true, const kdlib::OutputFlagsSet& captureFlags = kdlib::OutputFlag::Normal) { std::wstring debugResult; { AutoRestorePyState pystate; - debugResult = kdlib::debugCommand(command, suppressOutput); + debugResult = kdlib::debugCommand(command, suppressOutput, captureFlags); } if (debugResult.size() > 0 ) diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index 4f3511f..f407e62 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -42,7 +42,7 @@ BOOST_PYTHON_FUNCTION_OVERLOADS( terminateProcess_, pykd::terminateProcess, 0, BOOST_PYTHON_FUNCTION_OVERLOADS(closeDump_, pykd::closeDump, 0, 1); BOOST_PYTHON_FUNCTION_OVERLOADS( attachKernel_, pykd::attachKernel, 0, 1 ); BOOST_PYTHON_FUNCTION_OVERLOADS( evaluate_, pykd::evaluate, 1, 2 ); -BOOST_PYTHON_FUNCTION_OVERLOADS( debugCommand_, pykd::debugCommand, 1, 2 ); +BOOST_PYTHON_FUNCTION_OVERLOADS( debugCommand_, pykd::debugCommand, 1, 3 ); BOOST_PYTHON_FUNCTION_OVERLOADS( dprint_, pykd::dprint, 1, 2 ); BOOST_PYTHON_FUNCTION_OVERLOADS( dprintln_, pykd::dprintln, 1, 2 ); @@ -207,8 +207,10 @@ void pykd_init() "Break into debugger" ); python::def( "expr", pykd::evaluate, evaluate_( python::args( "expression", "cplusplus" ), "Evaluate windbg expression" ) ); - python::def( "dbgCommand", &pykd::debugCommand, - debugCommand_( python::args( "command", "suppressOutput"), "Run a debugger's command and return it's result as a string" ) ); + python::def( "dbgCommand", &pykd::debugCommand, debugCommand_( python::args( + "command", "suppressOutput", "outputMask"), + "Run a debugger's command and return it's result as a string. You can set additional outputMask" \ + "if you want to get also error messages" ) ); python::def( "go", pykd::targetGo, "Go debugging" ); python::def( "step", pykd::targetStep,