Re: Debugging issue to watch variable values - constructive options



> 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 mentioned
with the code I showed before? :-)

No, I can not run 64 bit code on my old 32 bit machine.

Norbert
.



Relevant Pages

  • RE: VS2003 Starts and Debugs Slower Than VS2002
    ... I had all ready verified it was not in mix-mode debugging (you ... VB projects (both windows and class libraries). ... slowly and take a long time to enter debug mode with an error occurs. ... This posting is provided "AS IS" with no warranties, ...
    (microsoft.public.vsnet.general)
  • Re: Why is Visual Studio debugging so slow?
    ... Well, debug mode is slow compared to release mode, but the slowness you are ... Unmanaged Debugging set to true. ... > quicker, but of course, I don't have the debugging then. ... > sitting blank for 30-40 seconds, then it says web site found, and finally ...
    (microsoft.public.dotnet.framework.aspnet)
  • Debug Question
    ... modify the debug attribute of the compilation element in the ... The first method is working fine -- but it turns detailed debugging on ... Note that this second technique will cause all files within a given ... application to be compiled in debug mode. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Tracing the execution of scripts?
    ... detailed logs ... in debug mode should I have a hard to find problem. ... that have no UI making debugging even more difficult. ... sensitive scripts so your mileage might vary. ...
    (comp.lang.python)

Loading