mr.dot
mr.dot

Reputation: 16

less stacks using StackWalk64

I built test.exe which will crash and generate .dmp file using MinidumpWriteDump, and parser.exe is used to read and print information from that dmp file.

In parser.exe I use StackWalk64 to get all stack traces of all threads in that dmp file. But now I found that I can only get less stacks than that visual studio did.

I've tried all solutions I could find in google、stackoverflow、codeproject, nothing changed.

The following is what parser.exe do:

  1. SymInitialize
  2. MiniDumpReadDumpStream to read all information
  3. SymLoadModuleEx & SymFindFileInPath to load pdb/exe/dll specified in .dmp file
  4. Initialize STACKFRAME64 and call StackWalk64 in loop.

I want to know how to get the same count of stack as visual studio. I could paste more code here if needed. Any help will be appreciated.

Upvotes: 0

Views: 790

Answers (1)

josh poley
josh poley

Reputation: 7479

StackWalk64 isn't robust enough to follow the full stack trace, especially through frames that have been optimized. (For example, see this stackoverflow question here).

The best approach is to actually use the debug engine supplied with WinDbg. Here are a couple of blog posts that show how to use the debug engine API:

Upvotes: 1

Related Questions