- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I have a large program that works perfectly well in debug mode but fails in release mode. The problem appears to be the closing of a file (on unit 1) but I'm unable to find out where this happens because it doesn't happen in debug mode.Could this be the result ofa volatile variable? I've heard about them but never met one before - how do I go about tracking it down?
Any suggestions?
With many thanks in advance,
Mike
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually, this could be a problem of uninitialized variable -- "volatile" is something entirely different (VOLATILE keyword declares that the variable is changeable outside of compiler's view, like a shared-memory mapped variable or a port value, and prevents certain optimization).
You can debug the release configuration, if you set "debug info" to "full" and rebuild. The stepping through the code can be kind of funny, and many variables are unreadable as they're stored in registers, but you still can have basic control what happens.
It can also happen, though, that it's not reproducible even in this case. It could help, though, to try to reproduce the exact conditions -- insert a call to DebugBreak() (use DFWIN) somewhere in your startup code, then run the program without debugger (Ctrl+F5). DebugBreak statement will cause the just-in-time debugger to attach itself to the process.
If that still doesn't help reproduce the problem, well...
Jugoslav
You can debug the release configuration, if you set "debug info" to "full" and rebuild. The stepping through the code can be kind of funny, and many variables are unreadable as they're stored in registers, but you still can have basic control what happens.
It can also happen, though, that it's not reproducible even in this case. It could help, though, to try to reproduce the exact conditions -- insert a call to DebugBreak() (use DFWIN) somewhere in your startup code, then run the program without debugger (Ctrl+F5). DebugBreak statement will cause the just-in-time debugger to attach itself to the process.
If that still doesn't help reproduce the problem, well...
Jugoslav

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page