How do i debug in Release mode

B

Bhavna Rohra

Hello everyone,

Sorry, it might sound easy for everyone but please if someone colud tell
me how to debug my MFC application in Release mode.

Thanks
 
S

Sharad Kala

Bhavna Rohra said:
Hello everyone,

Sorry, it might sound easy for everyone but please if someone colud tell
me how to debug my MFC application in Release mode.

This is certainly off-topic on this newsgroup.
<OT>
Release build itself means that the compiler has created no debugging
information in the executable. It also
does no kind of initializations for you unlike in debug build.
Check out the difference in the exe size in debug and release builds.
So ideally the way to work is that develop incrementally in debug mode and
simultaneously keep checking the program runs in release
build too. So comment out parts of your program and run till you can track the
problem.Else it's only left through print statements/logging mechanisms that you
can know where the problem is.
</OT>

-Sharad
 
S

SaltPeter

Bhavna Rohra said:
Hello everyone,

Sorry, it might sound easy for everyone but please if someone colud tell
me how to debug my MFC application in Release mode.

Thanks

MFC is not C++ and even less STL so your question is off topic. Any
application in release mode is not designed to provide debugging. Finally,
lets not get confused over Exception checking and debugging.

try microsoft.public.vc.mfc
 
P

Peter van Merkerk

you cannot
in release mode you can see only x86 assembly instructions

<offtopic>
With Visual Studio you can generate debug symbols even with release builds.
It is just a matter of setting the right compiler and linker options. If
you done that you can debug release builds as well. However debugging
optimized code is a bit awkward; lines of code are often not executed in
the same sequence as they appear in the source code and variables get
initialized at different times then what the source code suggests. So
jumping back and forth between source code and assembly code is sometimes
necessary to understand what is really going on. But that is still a lot
better than assembly code without any debugging symbols.
</offtopic>
 
C

Carl Muller

Sharad Kala said:
This is certainly off-topic on this newsgroup.
<OT>
Release build itself means that the compiler has created no debugging
information in the executable.

Still offtopic, but unintentionally misleading info upsets me :) In
VC++ Debug/Release is just a convention. You can turn debugging on or
off using the Project Settings window. This is useful for tracking
down compiler bugs or subtleties that don't appear when in Debug mode.

The merits/drawbacks of splitting your builds into two versions are
probably not on-topic either alas, since comp.lang.c++ assumes a
perfect compiler and no environmental issues.
 
T

TheGurr

Sharad Kala said:
So ideally the way to work is that develop incrementally in debug mode and
simultaneously keep checking the program runs in release
build too. So comment out parts of your program and run till you can track the
problem.Else it's only left through print statements/logging mechanisms that you
can know where the problem is.

A better approach is to use a logging framework (for example the free-to-use
developer's pack from www.appmind.com) where you can leave the traces in
your release-compiled and shipped executeables, and dynamically at runtime
control whether messages should be output or not...
 
Y

YouTho

SaltPeter said:
MFC is not C++ and even less STL so your question is off topic. Any
application in release mode is not designed to provide debugging. Finally,
lets not get confused over Exception checking and debugging.

try microsoft.public.vc.mfc

I am monitoring our C++ applications during execution in our
production environment and get all information I need! We use AppMind
on the app side and Patrol on the console side. It probably work ok
with OpenView or Tivoli to.

BYe
 
S

SaltPeter

YouTho said:
"SaltPeter" <[email protected]> wrote in message

I am monitoring our C++ applications during execution in our
production environment and get all information I need! We use AppMind
on the app side and Patrol on the console side. It probably work ok
with OpenView or Tivoli to.

BYe

Great, you are still off topic. Besides, writing log files and using shared
memory, which is how how AppMind works, has been within the C++ world way
before AppMind ever achieved birth. That has nothing to do with debugging
and its nothing magical since any C++ application can use an iostream to
achieve the same purpose (i'm willing to bet AppMind uses STL exclusively).
Lets face it, why write a library that only can work in Windows, like MFC?

Furthermore, while writing to an archive using MFC might seem like a magical
act to you, the STL library revolves around streams in a way infinitely more
fundamental than a stream might ever be to an MFC application (there is no
equivalent to an iostream in MFC). MFC is about Windows architectures, STL
is about all architectures.

MFC consists of wrapped structure APIs that are not C++. While MS calls them
"classes" they in fact are not C++ classes. Which is why your post is off
topic.

Furthermore, an MFC application requires an Application structure, a
framework, a document structure and even a View structure just to read input
and write to a file with feedback. None of which is portable to anything
non-Windows. The same job in STL requires about 20 lines of code and in some
cases even less. And it, unlike MFC, will work on virtually any platform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,427
Latest member
HildredDic

Latest Threads

Top