Re: Deugging release build of MFC app
- From: "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
- Date: Wed, 18 May 2005 16:27:02 -0500
Jay Daniel wrote:
Hey all,
I was hoping someone could shed some light on what's required to debug a release build of an MFC application in Visual Studio 2003. I'm creating a multithreaded app, and I find that things run as expected in debug mode, but fail in release mode.
I see that the default configuration for Release builds includes debug symbols, but when I step through the code, the values I see in the watch window don't jive with their "actual" values. For instance, if I have an integer member of my thread class, it appears in the watch window to be garbage. If, however, I format it as a string and pop up a messagebox (which is a no-no for a UI thread, I realize), then it displays the proper value that was assigned to it. Am I missing something very basic?
I'm running Windows XP SP2 on a P4 with hyperthreading if that makes any difference. Any help would be greatly appreciated.
Code optimizations in the release build can cause many strange effects in the debugger. You can try temporarily turning off optimizations in the release build for a more sane experience. But this may or may not hide the original problem :(
Another aid is to format strings and send them to OutputDebugString instead of to a message box. The strings appear in the debugger output window without stopping execution flow.
-- Scott McPhillips [VC++ MVP]
.
- Follow-Ups:
- Re: Deugging release build of MFC app
- From: Jay Daniel
- Re: Deugging release build of MFC app
- From: Jay Daniel
- Re: Deugging release build of MFC app
- References:
- Deugging release build of MFC app
- From: Jay Daniel
- Deugging release build of MFC app
- Prev by Date: Re: CSplitterWnd::CreateView fails sporadically - please advise!
- Next by Date: Re: How do I change control colors
- Previous by thread: Re: Deugging release build of MFC app
- Next by thread: Re: Deugging release build of MFC app
- Index(es):
Relevant Pages
|