News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Debugger doesn't show certain things

Started by 51423benam, July 30, 2018, 06:36:27 PM

Previous topic - Next topic

51423benam

Hello,

the codeblocks debugger (gdb) doesn't show me things I want to watch. For example in the watch windows I would want to exand "this" like I can do in VS (so that I can view member vars easily. Also, I can not watch contents of standard datatypes well, for example of std::vector in VS I can just see all Datafields of it. And these are not the only thing. The watch windows is nearly useless for me. Is that the problem of gdb of of codeblocks?

oBFusCATed

For this -> right click and select dereference this
For vector: install and setup python pretty-printer enabled gdb.

C::B's integration of the debugger is miles away from the one VS. On windows it is more troublesome than on linux.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

51423benam

Thanls for the reply. Where do I have to click on this? It doesn't work in the watches, so do I have to do that in the code? That would mean that I would have a 'this' in every class object I want to examine.

oBFusCATed

You have to add 'this' in the watches window and do the right click operation or just add *this in the watches.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

BlueHazzard

Here are some links that describe the activation of pretty printers:
http://wiki.codeblocks.org/index.php/Pretty_Printers
https://code.google.com/archive/p/qp-gcc/wikis/GDB.wiki
http://forums.next.codeblocks.org/index.php/topic,21998.msg149737.html#msg149737

we should integrate this better in the debugger plugin... But there are TONS of things to do....
If you have some trouble for one specific thing, please ask specific questions.... General questions are hard to answer and don't lead to a target....

BlueHazzard

Also if you try the steps it would be great if you could give some feedback, so that i can create a proper tutorial for this...

johne53

Quote from: oBFusCATed on July 30, 2018, 07:10:44 PM
C::B's integration of the debugger is miles away from the one VS. On windows it is more troublesome than on linux.

Gosh that's quite sad... maybe about 10 years ago I made the effort to switch from MSVC to GCC (primarily because it's cross-platform) but I soon gave up when I tried to use the GCC debugger (GDB). Admittedly that was 10 years ago but it was truly dreadful compared to debugging in Visual C++.

The GCC compiler seems to have come a long way since then but from what I've read, GDB still isn't much use as a serious debugging tool  :(

oBFusCATed

Why do you think GDB is not serious tool? As a pure debugger it is as powerful or sometimes more powerful than the VStudios debugger. The only part lacking is the UI at least in C::B.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

johne53

Here are the main things I remember about using C::B with GDB (keep in mind that this was 10 years ago...) Maybe you can let me know if these issues are solved now..?

1) Starting a debug session seemed to take forever (in C::B on Windows). After trying to launch a debug session it would often be minutes before anything happened (and the more break points I set, the longer it would take to launch).

2) IIRC I couldn't set break points 'on-the-fly' (they all needed to get set before launching GDB). In fact I'm not sure if I could even enable & disable break points on-the-fly.

3) As 51423benam noted earlier, sometimes you couldn't inspect variable values easily (or maybe you could inspect the values but not change them?)

4) You couldn't change the order of execution on-the-fly (e.g. if I stopped at a break point, I couldn't skip a few lines or go back a few lines).