I am trying to execute a column that contains both managed and native frames in an x64 process using StackWalk64. Everything works fine until the first or second managed frame, after which StackWalk64 cannot determine the return address of the frame and does not work.
I use SymFunctionTableAccess64 to call back the access to the function table, and the character handler is initialized with SymInitialize (). Is there any magic I need to do in dbghelp to get it to manage managed frames properly?
An example of a failed call:
UnmanagedFrame1
UnmanagedFrame2
UnmanagedFrame3
ManagedFrame1 <----- (StackWalk64 fails after this frame)
ManagedFrame2
UnmanagedFrame4
UnmanagedFrame5
ntdll!RtlUserThreadStart
Note: this question is NOT about how to allow managed frames to characters / method names / etc., I just want to go through the full stack without regard to character resolution, etc.
In addition, IDebugControl4 :: GetContextStackTrace works correctly, but DbgEng uses a custom function table callback and does not just delegate SymFunctionTableAccess64. I suspect the problem is that the CLR uses RtlInstallFunctionTableCallback to set the callback function table (which points to mscordacwks), and SymFunctionTableAccess64 is not smart enough to follow this.
I spent some time trying to write a function table access callback to cross the chain of function tables and call the callback in mscordacwks, but it was pretty sketchy and didn't really work.
Steve source share