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 windbg on your host OS uses the pdb file to translate line nubers in the source files to addresses in your guest OS (xp) . Then the the debugger agent uses this address to set break points (Int 3) in the guest OS. This is much in the same way as a local debugger do to a local process.
Drag and drop the generated source files you want to debug into Visual Studio. Place break points in the source code in Visual Studio. Open the menu option Debug > Attach to Process Ctrl + Alt + P in Visual Studio. Select menu option Run > Resume, if you selected Debug as > Real Time Application in RSA-RTE.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With