| dsil (3) | |||
|
I'm facing a strange behaviour with the debugger of VS2008. Looks that the debugger cannot see the variables defined inside a try/catch block My code is something like
The code is executed correctly, but when I debug f() breaking just before the catch I cannot see in a watch window the value of the variable a. Instead, I can see a_ (class member) and b (defined outside the try/catch block). I can also see x if I go inside g().I've never had this problem with VS2005. Dou you have any idea of what it's happening? Thank you very much, dsil | |||
|
Last edited on
|
|||
| ajh32 (163) | |||
Well to start with you need to set the accessability of your class, like:
So that we can actually test it. Then, when you debug the code you will find that your debugger will only be aware of the variable 'a' inside the try...catch block as it is only declared within that block i.e. it doesn't exist outside. If you are using Visual Studio you will be able to see the values of variables in the 'Autos' 'Locals' windows the 'Watch' window will only show you the values of variables that are both currently in scope and that you have specified you want to watch. HTH | |||
|
|
|||
| dsil (3) | |
|
Of course ajh32 (thank you for replying) this is a very simplified code, as an example of a more general problem. Think that A is a struct, or else that there is a public. I just edited the code adding the public keyword.My problem is that if I put a breakpoint at line 18 I should see the value of a, a_ and b, instead I cannot see a. In the watch window, where I put a, I read CXX0017:Error:symbol a not found | |
|
|
|
| ajh32 (163) | |
|
Well, if I do exactly the same albeit in VS2010, put a breakpoint at line 18 I see the following in my watch window for a, a_, and b: a : 8.0000000000000000 a_ : 1.0000000000000000 b : 9.0000000000000000 So, don't know why you are having this issue! | |
|
|
|
| dsil (3) | |
|
That's why I say it's strange... I really don't know how to investigate the origin of the issue. Maybe some debugging configuration? Maybe something related with x64 application? I see that there are other issues about debugging a x64 application in VS2008, for exampe Edit&Continue is not supported. I'm really confused... | |
|
|
|
| EssGeEich (1007) | |
| If you are using the release mode, some symbols are taken away for optimization. Also as you just wrote, x64 functionalities aren't of the best. | |
|
|
|