Re: Debugging issue to watch variable values - constructive options
- From: Ondrej Spanel <OndrejSpanel.news@xxxxxxxxxxxxx>
- Date: Thu, 16 Oct 2008 07:49:29 +0200
> Now you are telling people that you can't see the variables in release
> mode. Of course not, hey, it's the release mode after all. To see the
> variables, use debug mode. If you insist of using the release mode just
> for fun, that is your problem.
>
> I give up here, and you should do it, too.
I disagree here, as I am debugging release frequently, and I am watching variable values in release frequently. As I wrote in another answer, there is a practical way, even if it is not a very comfortable one. As you are able to view register values in the debugger, you have the access to the disassembly and to the source code, it is possible to track manually where the values are currently located. What you write to watch the variable in release looks usually something like (x86 examples, x64 may be slightly different):
To access
ObjectType *a
You need to established where "a" is located at your current code location. Assume it is ebx.
You write
(ObjectType *)ebx -
....and voila - you see the variable value.
> You can only get the correct value from register rcx. Do you think it is a
> bug of PDB file which is not reflecting the correct location of where local
> variable c is?
This is a debugger and pdb file limitation (not a bug, as it was designed intentionally to act this way). If you do not like this, your options are:
- debug debug
- learn how to debug release manually (which most of all means learn to read assembly)
- suggest this functionality be added to the Visual Studio via proper feedback channels (i.e. Connect Site) - Realistically I do not think such suggestion will be accepted, as I do not think you will find many other people wanting this, but you can always try.
- moan and moan and moan and moan about how compiler is broken and MS evil or bad or whatever :)
Cheers
Ondrej
Norbert Unterberg napsal(a):
.
George schrieb:
Debug version is fine.
Great, problem solved.
But for the release version, we cannot watch the local variable value in debugger.
Sure, it is the release version. Release versions can not be debugged that way. To solve the debugging problems of the release mode, the debug mode was invented. In debug mode you can see all variables, step through all inline and template code, see all stack frames, see all the call stack etc. In release mode, you just can't. I usually don't care if there might be a way to get information about some special variables in some special situations, I know that the release mode does not allow good debugging. End of story.
Now you are telling people that you can't see the variables in release mode. Of course not, hey, it's the release mode after all. To see the variables, use debug mode. If you insist of using the release mode just for fun, that is your problem.
I give up here, and you should do it, too.
> Could you reproduce the issue I mentionedwith the code I showed before? :-)
No, I can not run 64 bit code on my old 32 bit machine.
Norbert
- Follow-Ups:
- References:
- Re: Debugging issue to watch variable values
- From: George
- Re: Debugging issue to watch variable values
- From: Norbert Unterberg
- Re: Debugging issue to watch variable values
- Prev by Date: Re: Debugging issue to watch variable values - not implemented
- Next by Date: Re: test
- Previous by thread: Re: Debugging issue to watch variable values
- Next by thread: Re: Debugging issue to watch variable values - constructive option
- Index(es):
Relevant Pages
|
Loading