Raxvan
Raxvan

Reputation: 6515

CaptureStackBackTrace with file information

I'm using CaptureStackBackTrace and SymFromAddr to identify the functions in the callstack. Is there a way to find the source file of each symbol with this (i can't find any documentation for this)? Or i have to use StackWalk ?

Upvotes: 4

Views: 1675

Answers (1)

Raxvan
Raxvan

Reputation: 6515

The solution was to use SymGetLineFromAddr which gives the file path and the line number. In order to do this you must set SYMOPT_LOAD_LINES flag before calling SymInitialize. Also the 3'rd argument of SymGetLineFromAddr must be not NULL, otherwise it will crash.

Upvotes: 5

Related Questions