I made C++ application to use with WinDbg, and intentionally add access violation run-time error.
Application was compiled as release build, and then I copied exe from release folder to desktop. Still when I use WinDbg, and application crashes, it open my source code file showing error line highlighted.
I am not able to understand, how WinDbg understand my source code file path.
Also, when I get crash dump from client, it may be possible, I do not have source code available with me. So I want to simulate real world scenario.
Regards
The way I understand it, Visual Studio compiler generates a .pdb file for any executable it creates (when
/DEBUG
flag is set). This PDB (Program Database) file contains information (including paths to source files) required for the debugger to match address in a binary module to source code. And it seems that a path to .pdb is hard-coded into the binary. So when you move a binary itself, debugger can still find pdb, from which it finds the sources.All paths are probably absolute and will only work on the PC which compiled the binary.