tags:

views:

702

answers:

3

Hello everyone,

I'm implementing a crash reporting tool for a game I'm writing, and I'd like to provide a (fairly) detailed native stack trace for the report. I've already implemented this on GNU/Linux, but I'm having trouble on Windows. Here's some sample code I tried to get working:

http://pastebin.com/m30b50f76

Each time I call SymFromAddr, I get the error "Attempt to access invalid address." Does anyone have experience with using StackWalk64/SymFromAddr and their kin?

Thanks, Rob

+7  A: 

Why not just capture a minidump and send that along with the report? You can rebuild the stack trace yourself in the debugger and you'll get all of your local variables as well as all of the stacks for the other threads.

Also, I think that error is because you're missing the symbols(PDB) for your program.

Jesse Weigert
+2  A: 

See here http://stackoverflow.com/questions/301892/printing-the-stack-trace-in-c-msvc for an answer StackWalker by Jochen Kalmbach [MVP VC++] as it does all the complicated stuff to get the StackWalk64 API working for you.

Len Holgate