CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Location
    San Antonio TX
    Posts
    380

    Debug Tricks/Methods

    All: How do you deal with debugging code that doesn't exhibit the bug when compiled in debug mode.

    I have had to deal with this scenario atleast once a year for quite awhile now. A bug is reported in the production software. You can't reproduce it when the software is compiled in debug mode. The only way to reproduce it is to compile in release mode.

    One of the things I do - and I am sure everyone does - is to start putting printf's or cout's in the code. However, I have also had to deal with putting a printf in the code and then the bug disappears or moves to a different location.
    John 3:16
    For God so loved the world ...

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Debug Tricks/Methods

    If it is seen with release mode, try enabling the Program Database and Debug Info for the release mode (in project settings C++->General->Program Database & Linker->Debug information).

    If that does not help, then try using log files. Map file will also be a good idea.

    Following articles might help,

    Surviving the Release Version

    Debugging Release Mode Problems

    BTW, this being a technical question, you should have posted it in VC++ forum.
    Regards,
    Ramkrishna Pawar

  3. #3
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Debug Tricks/Methods

    Quote Originally Posted by kenrus

    One of the things I do - and I am sure everyone does - is to start putting printf's or cout's in the code. However, I have also had to deal with putting a printf in the code and then the bug disappears or moves to a different location.
    This is a classic heap corruption case, there could be memory leaks problem too.
    Regards,
    Ramkrishna Pawar

  4. #4
    Join Date
    May 2003
    Location
    San Antonio TX
    Posts
    380

    Re: Debug Tricks/Methods

    Quote Originally Posted by Krishnaa
    If it is seen with release mode, try enabling the Program Database and Debug Info for the release mode (in project settings C++->General->Program Database & Linker->Debug information).

    If that does not help, then try using log files. Map file will also be a good idea.

    Following articles might help,

    Surviving the Release Version

    Debugging Release Mode Problems

    BTW, this being a technical question, you should have posted it in VC++ forum.
    Thanks for the links. That information will prove useful.

    Kendall
    John 3:16
    For God so loved the world ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured