Viewing class static members in debugger

General questions regarding the usage of CodeLite
Arbalest
CodeLite Enthusiast
Posts: 30
Joined: Wed Oct 03, 2012 6:12 am
Genuine User: Yes
IDE Question: C++
Contact:

Viewing class static members in debugger

Post by Arbalest »

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.
User avatar
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

Post by eranif »

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.
Atm, there are 2 ways to watch globals:

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
2.png
1.png
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
Arbalest
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

Post by Arbalest »

1) Explicitly type its full name in the "Watches"
2) Select it (its full path) in the editor and then Ctrl-Click
Interesting - I tried both methods before posting my question. It does
not work in my environment.

This is a small test program and everything is in main.cpp, not that
it should matter.
User avatar
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

Post by eranif »

So this is the time to ask the additional information:
- Which OS?
- Which gdb version?

Eran
Make sure you have read the HOW TO POST thread
Arbalest
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

Post by Arbalest »

Windows XP (all updates applied).

GDB 7.0
Post Reply