From 0b3bb3e6cbc127ac0744a8558f0a6866097a077b Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Fri, 15 Feb 2013 15:36:48 +0000 Subject: [PATCH] [0.2.x] fixed: added some workaroudns for getting pointer size for old pdb for WINXP64 ( they have wrong machine type ) git-svn-id: https://pykd.svn.codeplex.com/svn@82668 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/typeinfo.cpp | 15 ++++++++------- snippets/stkwalk.py | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pykd/typeinfo.cpp b/pykd/typeinfo.cpp index 64fa31a..0f524c4 100644 --- a/pykd/typeinfo.cpp +++ b/pykd/typeinfo.cpp @@ -126,7 +126,11 @@ ULONG64 TypeInfo::getOffset( const std::string &fullName ) inline ULONG getTypePointerSize( SymbolPtr &typeSym ) { - return (typeSym->getMachineType() == IMAGE_FILE_MACHINE_AMD64) ? 8 : 4; + ULONG symTag = typeSym->getSymTag(); + if ( symTag != SymTagPointerType ) + return (typeSym->getMachineType() == IMAGE_FILE_MACHINE_AMD64) ? 8 : 4; + + return (ULONG)typeSym->getSize(); } ///////////////////////////////////////////////////////////////////////////////////// @@ -155,12 +159,10 @@ TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &typeSym ) break; } - ptr = getTypeInfo( typeSym->getType() ); - break; + return getTypeInfo( typeSym->getType() ); case SymTagBaseType: - ptr = getBaseTypeInfo( typeSym ); - break; + return getBaseTypeInfo( typeSym ); case SymTagUDT: case SymTagBaseClass: @@ -172,8 +174,7 @@ TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &typeSym ) break; case SymTagPointerType: - ptr = TypeInfoPtr( new PointerTypeInfo( typeSym ) ); - break; + return TypeInfoPtr( new PointerTypeInfo( typeSym ) ); case SymTagVTable: ptr = TypeInfoPtr( new PointerTypeInfo( typeSym->getType() ) ); diff --git a/snippets/stkwalk.py b/snippets/stkwalk.py index 4ac8894..cf70970 100644 --- a/snippets/stkwalk.py +++ b/snippets/stkwalk.py @@ -153,7 +153,7 @@ def printProcess(process,processFilter,threadFilter,moduleFilter,funcFilter,prin dbgCommand( ".reload /user" ) - threadLst = nt.typedVarList(process.ThreadListHead, "_ETHREAD", "ThreadListEntry") + threadLst = nt.typedVarList(process.ThreadListHead, "_ETHREAD", "ThreadListEntry.Flink") filteredThreadLst = [] stackHashes = set() @@ -226,7 +226,7 @@ def main(): currentProcess = getCurrentProcess() currentThread = getImplicitThread() - processLst = nt.typedVarList( nt.PsActiveProcessHead, "_EPROCESS", "ActiveProcessLinks") + processLst = nt.typedVarList( nt.PsActiveProcessHead, "_EPROCESS", "ActiveProcessLinks.Flink") for process in processLst: printProcess( process, processFilter, threadFilter, moduleFilter, funcFilter, printopt )