diff --git a/pykd/module.cpp b/pykd/module.cpp index 620a6f7..20f0bad 100644 --- a/pykd/module.cpp +++ b/pykd/module.cpp @@ -101,47 +101,6 @@ SymbolSessionPtr& Module::getSymSession() throw SymbolException( "failed to load symbol file" ); } -///////////////////////////////////////////////////////////////////////////////////// - - - // std::string m_symfile; - //ULONG64 m_base; - //ULONG m_size; - //ULONG m_timeDataStamp; - //ULONG m_checkSum; - - //try - //{ - // m_symSession = loadSymbolFile(m_base, m_imageName, m_symfile); - //} - //catch(const SymbolException &e) - //{ - // DBG_UNREFERENCED_LOCAL_VARIABLE(e); - //} - //if (m_symSession) - // return m_symSession; - - //// TODO: read image file path and load using IDiaReadExeAtOffsetCallback - - //m_symfile = getModuleSymbolFileName(m_base); - //if (!m_symfile.empty()) - //{ - // try - // { - // m_symSession = loadSymbolFile(m_symfile, m_base); - // } - // catch(const SymbolException &e) - // { - // DBG_UNREFERENCED_LOCAL_VARIABLE(e); - // } - // if (m_symSession) - // return m_symSession; - - // m_symfile.clear(); - //} - - //throw SymbolException( "failed to load symbol file" ); - ///////////////////////////////////////////////////////////////////////////////////// SymbolPtr& Module::getSymScope() diff --git a/pykd/pykdver.h b/pykd/pykdver.h index fc782d3..14e1e2d 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 9 +#define PYKD_VERSION_BUILDNO 10 #define __VER_STR2__(x) #x diff --git a/pykd/typeinfo.cpp b/pykd/typeinfo.cpp index 1bf736f..48ad70b 100644 --- a/pykd/typeinfo.cpp +++ b/pykd/typeinfo.cpp @@ -95,7 +95,7 @@ std::string TypeInfo::findSymbol( ULONG64 offset, bool safe) catch( DbgException& ) { std::stringstream sstr; - sstr << module->getName() << '!' << std::hex << ( offset - module->getBase() ); + sstr << module->getName() << '+' << std::hex << ( offset - module->getBase() ); return sstr.str(); } diff --git a/pykd/win/dbgeng.cpp b/pykd/win/dbgeng.cpp index a56d986..13146a6 100644 --- a/pykd/win/dbgeng.cpp +++ b/pykd/win/dbgeng.cpp @@ -1002,6 +1002,9 @@ void getStackTraceWow64(std::vector &frames) if (S_OK != hres) throw DbgException( "IDebugControl::GetEffectiveProcessorType", hres ); + WOW64_CONTEXT Context; + ReadWow64Context(Context); + AutoRevertEffectiveProcessorType autoRevertEffectiveProcessorType; if (IMAGE_FILE_MACHINE_I386 != processorType) { @@ -1015,10 +1018,28 @@ void getStackTraceWow64(std::vector &frames) autoRevertEffectiveProcessorType.to(IMAGE_FILE_MACHINE_AMD64); } - WOW64_CONTEXT Context; - ReadWow64Context(Context); + ULONG filledFrames = 1024; + std::vector dbgFrames(filledFrames); - buildStacksFrames(frames, Context.Ebp, Context.Esp, Context.Eip); + hres = g_dbgEng->control->GetContextStackTrace( + &Context, + sizeof(Context), + &dbgFrames[0], + filledFrames, + NULL, + filledFrames*sizeof(Context), + sizeof(Context), + &filledFrames ); + + frames.resize(filledFrames); + for ( ULONG i = 0; i < filledFrames; ++i ) + { + frames[i].number = dbgFrames[i].FrameNumber; + frames[i].instructionOffset = dbgFrames[i].InstructionOffset; + frames[i].returnOffset = dbgFrames[i].ReturnOffset; + frames[i].frameOffset = dbgFrames[i].FrameOffset; + frames[i].stackOffset = dbgFrames[i].StackOffset; + } } ///////////////////////////////////////////////////////////////////////////////