简体   繁体   中英

How to find where program crashed

I have a program that crashes (attempting to read a bad memory address) while running the "release" version but does not report any problems while running the "debug" version in the visual studio debugger.

When the program crashes the OS asks if I'd like to open up the debugger, and if I say yes then I see an arrow pointing to where I am in a listing of some assembler which I am not skilled enough to read properly (I learned 6502 assembler 30 years ago). Is there any way for my to determine where in my sourcecode the offending memory read was located?

You need to build your program with Debug info enabled (which you can do even for release builds) and that debug info (*.pdb files) must be accessible to the debugger (just copy it beside the executable).
The VS should be able to show you the source, stack and everything else.

Just want to add one point apart from what sbi has told you. There are Microsoft Debugging Tools for Windows. This package contains a good book "Debugging Help". Even if you are not going to use WinDbg to analyze crashes you might find reading the "Debugging Help" quite useful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM