Author Topic: STL Pretty Print last column  (Read 5454 times)

Offline GravityWell

  • Multiple posting newcomer
  • *
  • Posts: 18
STL Pretty Print last column
« on: October 25, 2012, 04:27:44 am »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12691
    • Travis build status
Re: STL Pretty Print last column
« Reply #1 on: October 25, 2012, 09:25:06 am »
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!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5241
Re: STL Pretty Print last column
« Reply #2 on: October 25, 2012, 10:04:42 am »
turning long string into fixed width, multiple line ?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12691
    • Travis build status
Re: STL Pretty Print last column
« Reply #3 on: October 25, 2012, 10:18:59 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!]

Offline jarod42

  • Multiple posting newcomer
  • *
  • Posts: 82
Re: STL Pretty Print last column
« Reply #4 on: October 25, 2012, 10:21:24 am »
[OT] fun to see that "four" == 5 with the definition just above with "four" = 4. :-)
(I assume that it was changed later).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: STL Pretty Print last column
« Reply #5 on: October 25, 2012, 11:15:04 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: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12691
    • Travis build status
Re: STL Pretty Print last column
« Reply #6 on: October 25, 2012, 11:45:39 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!]

Offline GravityWell

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: STL Pretty Print last column
« Reply #7 on: October 25, 2012, 02:34:17 pm »
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.

Offline PaulS

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: STL Pretty Print last column
« Reply #8 on: October 25, 2012, 04:40:09 pm »
I would very much appreciate a quick guuide.  Please do.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12691
    • Travis build status
Re: STL Pretty Print last column
« Reply #9 on: October 25, 2012, 04:41:16 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!]

Offline GravityWell

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: STL Pretty Print last column
« Reply #10 on: October 25, 2012, 05:28:48 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.
« Last Edit: October 25, 2012, 05:57:11 pm by GravityWe11 »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5241
Re: STL Pretty Print last column
« Reply #11 on: October 25, 2012, 08:26:12 pm »
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    ;-)

Offline GravityWell

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: STL Pretty Print last column
« Reply #12 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12691
    • Travis build status
Re: STL Pretty Print last column
« Reply #13 on: October 25, 2012, 09:16:22 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:)

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

Offline GravityWell

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: STL Pretty Print last column
« Reply #14 on: October 26, 2012, 05:07:58 am »
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'.