User forums > Using Code::Blocks

Debugger: use gdb python pretty printer for the libstdcxx under msys2

<< < (3/3)

AndrewCot:
Feedback on feedback:
1). "Disable startup scripts (-nx) (GDB only)" option.

--- Quote ---In the Menu->Settings->Debugger settings. Open the debugger plugin setting dialog and uncheck the "Disable startup scripts (-nx) (GDB only)" option.
>> I think this option should be "checked on", I mean we don't need the startup scripts.
--- End quote ---

If I leave the option checked [X] then the pretty printer does not work and the watch looks like it does when no pretty printer is defined for wxWidget. If uncheck [ ] the option then the GDB pretty printer watch displays a wxString in a human read able format. See attachment showing this.

2.gdbinit file:

--- Quote --- If you are using the https://github.com/wxWidgets/wxWidgets/blob/master/misc/gdb/print.py file then add the following to the gdbinit file:
    sys.path.insert(0, 'D:/temp')         
    from wxprint import register_wxwidgets_printers
    register_wxwidgets_printers (None)
    Rember to change the directory to where you have saved the print.py file.

>>I don't do like that, I just shows what I did in this post:
>>Re: Debugger: use gdb python pretty printer for the libstdcxx under msys2
>>You don't need the "hard-coded path" in those settings.
--- End quote ---

I think the page still needs an update to add the info so someone does not need to find in the forum post (like I had to do as it did not work due to item 1), but I also had to get the syntax correct in the gdbinit):
a) Copy the https://github.com/wxWidgets/wxWidgets/blob/master/misc/gdb/print.py into :
      Linux: /etc    (checked on Linux Mint 20.1 Virtual machine)
      Windows - MSYS2: x:\msys64\mingw64\etc or x:\msys64\mingw32\etc where x: is the drive you installed Msys2 onto and depending on if you are using the 32 or 64 bit compiler
      Windows - Cygwin: - Looks like it supports pretty printing, but by default no gdbinit file exists.
      Windows - Mingw64: TBA
      MacOSx: TBA
a) Add the following to gdbinit  in the directory in the step above:

--- Code: ---sys.path.insert(0, sys.path[0] + '/../../../etc')
import wxprint
--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version