Is there a way to display the contents of static members of a class in the debugger? When I float over it and click CTRL nothing happens. When I add members to the Watch tab of the debugger nothing happens.
I am declaring and initializing the class and it's members before main() but I am not instantiating an instance of it. I thought I would be able to look at the contents of this static class as if it were any other global data.
Also, I don't see a tab to display "globals" in the same way you can display "locals" but I have been able to type other global expressions in the Watches tab and see them there. If there is a global tab I would like to know how to add it to the debugger pane but the main question here is how to see the values of static class members any which way.
Viewing class static members in debugger
-
- CodeLite Enthusiast
- Posts: 30
- Joined: Wed Oct 03, 2012 6:12 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Viewing class static members in debugger
Atm, there are 2 ways to watch globals:Arbalest wrote:Is there a way to display the contents of static members of a class in the debugger? When I float over it and click CTRL nothing happens. When I add members to the Watch tab of the debugger nothing happens.
I am declaring and initializing the class and it's members before main() but I am not instantiating an instance of it. I thought I would be able to look at the contents of this static class as if it were any other global data.
Also, I don't see a tab to display "globals" in the same way you can display "locals" but I have been able to type other global expressions in the Watches tab and see them there. If there is a global tab I would like to know how to add it to the debugger pane but the main question here is how to see the values of static class members any which way.
1) Explicitly type its full name in the "Watches"
2) Select it (its full path) in the editor and then Ctrl-Click
There is no "Globals" tab, there is a good a reason for this: if you type "info variables" - you will get tons of data (which in most cases, you dont care about)
We can introduce such tab that will work "on demand" with some kind of filters - please post a feature request on sourceforge - or it will get lost in this forum
Attached 2 screenshots that shows how you can currently view static members of a class Eran
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 30
- Joined: Wed Oct 03, 2012 6:12 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Viewing class static members in debugger
Interesting - I tried both methods before posting my question. It does1) Explicitly type its full name in the "Watches"
2) Select it (its full path) in the editor and then Ctrl-Click
not work in my environment.
This is a small test program and everything is in main.cpp, not that
it should matter.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Viewing class static members in debugger
So this is the time to ask the additional information:
- Which OS?
- Which gdb version?
Eran
- Which OS?
- Which gdb version?
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 30
- Joined: Wed Oct 03, 2012 6:12 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Viewing class static members in debugger
Windows XP (all updates applied).
GDB 7.0
GDB 7.0