Author Topic: GUIDE - STL Pretty Print in Code::Blocks  (Read 14732 times)

Offline GravityWell

  • Multiple posting newcomer
  • *
  • Posts: 18
GUIDE - STL Pretty Print in Code::Blocks
« on: October 25, 2012, 05:15:49 pm »
Guide is now on the Codeblocks Wiki
« Last Edit: October 26, 2012, 04:08:08 am by GravityWe11 »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: GUIDE - STL Pretty Print in Code::Blocks
« Reply #1 on: October 25, 2012, 05:19:22 pm »
Can you add this to the wiki ?
You can use the same credentials to login there as for he forum.

Offline GravityWell

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: GUIDE - STL Pretty Print in Code::Blocks
« Reply #2 on: October 25, 2012, 07:37:44 pm »
Done. I don't know if I should add a link somewhere on the main Wiki page.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: GUIDE - STL Pretty Print in Code::Blocks
« Reply #3 on: October 26, 2012, 02:07:32 am »
Done. I don't know if I should add a link somewhere on the main Wiki page.
Nice work.
I see in wiki page:
Quote
Comment out the Codeblocks gdb handler:
, I think it is not necessary, because we have an option in debugger setting dialog.
"Enable watch scripts", just uncheck it. :)

BTW: you can add many other pretty printers like wxWidgets' pretty printers.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline GravityWell

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: GUIDE - STL Pretty Print in Code::Blocks
« Reply #4 on: October 26, 2012, 02:50:52 am »
Nice work.
I see in wiki page:
Quote
Comment out the Codeblocks gdb handler:
, I think it is not necessary, because we have an option in debugger setting dialog.
"Enable watch scripts", just uncheck it. :)

BTW: you can add many other pretty printers like wxWidgets' pretty printers.

Thanks, I didn't realize that option was there. Wiki page is updated to use this much easier method. I haven't started using wxWidgets yet. Is the built-in watch script broken for that too?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: GUIDE - STL Pretty Print in Code::Blocks
« Reply #5 on: October 26, 2012, 02:59:16 am »
Is the built-in watch script broken for that too?
I think the built-in script for wx can only handle wxString class, but the pretty-printer for wx also support many other class (wxRect, wxArrayString.....)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: GUIDE - STL Pretty Print in Code::Blocks
« Reply #6 on: October 26, 2012, 07:39:41 am »
and what needs to be done for linux ? The guide doesn't mention that.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: GUIDE - STL Pretty Print in Code::Blocks
« Reply #7 on: October 26, 2012, 09:24:28 am »
and what needs to be done for linux ? The guide doesn't mention that.
GDB on linux should be able to find the pretty printers automagically.
So it should just work. The STL ones are shipped with gcc >=4.5 by default.

Probably I should remove the old scripting functionallity at all :)
(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 Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: GUIDE - STL Pretty Print in Code::Blocks
« Reply #8 on: October 26, 2012, 10:02:44 am »
Probably I should remove the old scripting functionallity at all :)

Ohh, than i should not implement it in the CDB Plugin?

Martin

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: GUIDE - STL Pretty Print in Code::Blocks
« Reply #9 on: October 26, 2012, 12:30:27 pm »
Ohh, than i should not implement it in the CDB Plugin?
You can do it in a CDB specific way probably. As far as I remember the scripting is inside the GDB plugin, not in the public API.
(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: GUIDE - STL Pretty Print in Code::Blocks
« Reply #10 on: October 26, 2012, 07:20:00 pm »
and what needs to be done for linux ? The guide doesn't mention that.
GDB on linux should be able to find the pretty printers automagically.
So it should just work. The STL ones are shipped with gcc >=4.5 by default.

Probably I should remove the old scripting functionallity at all :)

I'm working on adding this to Linux, and will update the guide. As far as I can tell, the printers are not included with GDB, at least with my version of Ubuntu. I had to download the printer and make a command file.

A problem with Codeblocks on Ubuntu is this:


I think a work around is to manually edit Codeblocks default.conf.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: GUIDE - STL Pretty Print in Code::Blocks
« Reply #11 on: October 26, 2012, 07:31:12 pm »
I'm working on adding this to Linux, and will update the guide. As far as I can tell, the printers are not included with GDB, at least with my version of Ubuntu. I had to download the printer and make a command file.
Probably they are in a separate package you need to install.
Or this might be bug in ubuntu https://lists.ubuntu.com/archives/foundations-bugs/2011-October/046696.html

A problem with Codeblocks on Ubuntu is this:


I think a work around is to manually edit Codeblocks default.conf.
Which version of C::B is this?
(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: GUIDE - STL Pretty Print in Code::Blocks
« Reply #12 on: October 26, 2012, 07:48:08 pm »
8466 - Oct 21 2012 via the Pasgui PPA.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: GUIDE - STL Pretty Print in Code::Blocks
« Reply #13 on: October 26, 2012, 09:10:48 pm »
(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: GUIDE - STL Pretty Print in Code::Blocks
« Reply #14 on: October 26, 2012, 09:27:49 pm »
I have the python printers working in Ubuntu and will update the guide soon. Can anyone say why the -nx parameter is always being passed to GDB from Codeblocks?
http://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html
It disables GDB startup commands, so this removes our option to add pretty printers to ~/.gdbinit.