diff --git a/pykd/dbgengine.h b/pykd/dbgengine.h index 535ce71..eaf3ef2 100644 --- a/pykd/dbgengine.h +++ b/pykd/dbgengine.h @@ -69,6 +69,8 @@ struct STACK_FRAME_DESC { void getStackTrace(std::vector &frames); +void getStackTraceWow64(std::vector &frames); + // callback events enum DEBUG_CALLBACK_RESULT { diff --git a/pykd/pykdver.h b/pykd/pykdver.h index 6cf2226..53d5ef2 100644 --- a/pykd/pykdver.h +++ b/pykd/pykdver.h @@ -2,7 +2,7 @@ #define PYKD_VERSION_MAJOR 0 #define PYKD_VERSION_MINOR 2 #define PYKD_VERSION_SUBVERSION 0 -#define PYKD_VERSION_BUILDNO 6 +#define PYKD_VERSION_BUILDNO 7 #define __VER_STR2__(x) #x diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index 36b1c9a..1a5f4c7 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -246,6 +246,8 @@ BOOST_PYTHON_MODULE( pykd ) // stack and local variables python::def( "getStack", &getCurrentStack, "Return a current stack as a list of stackFrame objects" ); + python::def( "getStackWow64", &getCurrentStackWow64, + "Return a stack for wow64 context as a list of stackFrame objects" ); python::def( "getFrame", &getCurrentStackFrame, "Return a current stack frame" ); python::def( "getLocals", &getLocals, diff --git a/pykd/stkframe.cpp b/pykd/stkframe.cpp index 2080af9..db6c66d 100644 --- a/pykd/stkframe.cpp +++ b/pykd/stkframe.cpp @@ -365,6 +365,24 @@ python::list getCurrentStack() //////////////////////////////////////////////////////////////////////////////// +python::list getCurrentStackWow64() +{ + std::vector frames; + getStackTraceWow64( frames ); + + python::list frameList; + + for ( ULONG i = 0; i < frames.size(); ++i ) + { + python::object frameObj( StackFramePtr( new StackFrame( frames.at(i) ) ) ); + frameList.append( frameObj ); + } + + return frameList; +} + +//////////////////////////////////////////////////////////////////////////////// + StackFramePtr getCurrentStackFrame() { std::vector frames; diff --git a/pykd/stkframe.h b/pykd/stkframe.h index d0e6468..dd8f912 100644 --- a/pykd/stkframe.h +++ b/pykd/stkframe.h @@ -136,6 +136,8 @@ StackFramePtr getCurrentStackFrame(); python::list getCurrentStack(); +python::list getCurrentStackWow64(); + ScopeVarsPtr getLocals(); ScopeVarsPtr getParams(); diff --git a/pykd/win/dbgeng.cpp b/pykd/win/dbgeng.cpp index 3924b99..814a18a 100644 --- a/pykd/win/dbgeng.cpp +++ b/pykd/win/dbgeng.cpp @@ -750,6 +750,15 @@ void getStackTrace(std::vector &frames) /////////////////////////////////////////////////////////////////////////////// +void getStackTraceWow64(std::vector &frames) +{ + PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate ); + + frames.resize(0); +} + +/////////////////////////////////////////////////////////////////////////////// + std::string processorToStr(ULONG processorMode) { switch( processorMode )