I saw a very good way to get the symbol name from the following post.
But what about getting the file name and line number. I tried to use the SymGetLineFromAddr64 but could not get this debug information.
I saw a very good way to get the symbol name from the following post.
But what about getting the file name and line number. I tried to use the SymGetLineFromAddr64 but could not get this debug information.
If you couldn't get this debug information, and your code was correct, then the problem could be with the options. You need SYMOPT_LOAD_LINES
to have this information loaded:
SymSetOptions(SYMOPT_LOAD_LINES);
Then, supposing you are using the code from the link you provided, it would be like this:
DWORD dwDisplacement;
IMAGEHLP_LINE64 line;
SymGetLineFromAddr64(process, (DWORD64)stack[i], &dwDisplacement, &line);
Now you can access these line
members (from the IMAGEHLP_LINE64 structure):
DWORD LineNumber;
PTSTR FileName;