News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

STL Pretty Print last column

Started by GravityWell, October 25, 2012, 04:27:44 AM

Previous topic - Next topic

GravityWell

First, thanks for a great C++ IDE!

I just got STL pretty printing working with GDB. The only thing I would change is the last column stretches the length of my 22inch monitor. I don't think that part comes from pretty print, because it doesn't appear in GDB if I print the variable in the console. Is there anyway to adjust this to make my IDE a little nicer to look at?


Thanks.

oBFusCATed

It is returned by the whatis command, so this is a gcc/gdb problem.
C::B can't do anything about it.
(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!]

killerbot

turning long string into fixed width, multiple line ?

oBFusCATed

Quote from: killerbot on October 25, 2012, 10:04:42 AM
turning long string into fixed width, multiple line ?
No, why would I do that? Most of the times you know what is the type of the variable.
(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!]

jarod42

[OT] fun to see that "four" == 5 with the definition just above with "four" = 4. :-)
(I assume that it was changed later).

MortenMacFly

Quote from: oBFusCATed on October 25, 2012, 10:18:59 AM
Quote from: killerbot on October 25, 2012, 10:04:42 AM
turning long string into fixed width, multiple line ?
No, why would I do that? Most of the times you know what is the type of the variable.
But what you can do is before showing a long string, truncate it after a few number of characters, so that the UI fits in the screen like:
"std::map<std::basic_string<char (...)"

BTW: I've never used that, what steps do I need to take to see this pretty printed stuff? (Please ignore my ignorance so far... :-[)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

Quote from: MortenMacFly on October 25, 2012, 11:15:04 AM
BTW: I've never used that, what steps do I need to take to see this pretty printed stuff? (Please ignore my ignorance so far... :-[)
Search for python pretty printers in the forum or gdb pretty printers in google :)
(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!]

GravityWell

Quote from: oBFusCATed on October 25, 2012, 11:45:39 AM
Search for python pretty printers in the forum or gdb pretty printers in google :)
There's actually quite a bit of confusing and outdated info on enabling pretty printers in GDB/CB. It's not that hard once you know how. I can make a quick guide.

PaulS

I would very much appreciate a quick guuide.  Please do.

oBFusCATed

Quote from: GravityWe11 on October 25, 2012, 02:34:17 PM
There's actually quite a bit of confusing and outdated info on enabling pretty printers in GDB/CB. It's not that hard once you know how. I can make a quick guide.
Yes, please, if you have time write a guide. It will be very helpful.
You can do it on the wiki (use the same login name/password as the one used for the forum).
(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!]

GravityWell

#10
Quote from: oBFusCATed on October 25, 2012, 04:41:16 PM
Yes, please, if you have time write a guide. It will be very helpful.
You can do it on the wiki (use the same login name/password as the one used for the forum).

Posted in the forum, in the process of adding it to the Wiki.

killerbot

Quote from: oBFusCATed on October 25, 2012, 10:18:59 AM
Quote from: killerbot on October 25, 2012, 10:04:42 AM
turning long string into fixed width, multiple line ?
No, why would I do that? Most of the times you know what is the type of the variable.

no we don't : auto x    ;-)

GravityWell

As with any GUI element, I think there should be a maximum size (maybe user configurable), and it shouldn't just keep expanding indefinitely off the screen even if there is a lot of text. Maybe select a reasonable default maximum size and let the user resize the popup and save the size settings.

oBFusCATed

Quote from: killerbot on October 25, 2012, 08:26:12 PM
no we don't : auto x    ;-)
You know, but you don't care about it:) or said otherwise you don't need to know the type, it is not human readable anyway:)

Quote from: GravityWe11 on October 25, 2012, 09:07:56 PM
As with any GUI element, I think there should be a maximum size (maybe user configurable), and it shouldn't just keep expanding indefinitely off the screen even if there is a lot of text. Maybe select a reasonable default maximum size and let the user resize the popup and save the size settings.
I can limit it, but resizing is hard with popups, everything is hard with popups :(

(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!]

GravityWell

I guess the only time it comes into play is with the STL templates. If there was some way to get the python pretty printer to handle that column, the "whatis" from GDB, then we could just modify the printer, to make it return something nice like just "vector", or "vector of strings", rather than a huge line of gibberish. The user could always look at the code to see what makes up the vector, but in any case, if it was controlled by pretty printer, we could make it do what we want. I haven't been able to figure out if GDB's python can intercept and handle 'whatis'.