Problems with gdb pretty-printers

Victor Vicente de Carvalho victor.v.carvalho at gmail.com
Thu May 13 20:10:33 UTC 2010


2010/5/13 Niko Sams <niko.sams at gmail.com>

> On Thu, May 13, 2010 at 20:20, Victor Vicente de Carvalho
> <victor.v.carvalho at gmail.com> wrote:
> >
> > 2010/5/13 Niko Sams <niko.sams at gmail.com>
> >>
> >> > Printing an Any on gdb witch contains strings returns a nicely
> formated
> >> > output. On KDevelop, it's show as it wasn't recognized.
> >> Is the pretty printer loaded correctly?
> >> is the to_string method called at all? (You can test using print
> >> statements in python
> >> and watching kdevelop console output.
> >>
> > Yes, as I have other printers on the same module and they work fine, and
> for
> > this printer basic structures like ints and booleans are converted right.
> > Also on gdb terminal the same module prints the correct output. I'm
> making
> > the import from my ~/.gdbinit.
> >
> To tackle this issue it would be most helpful to get a simplified test
> case that consists of:
> - you debugee (including your custom class) - simplified to only necessary
> code
> - the pretty printer (simplified as well)
> - kdevelop console output when debugging
>
>
Ok, I've attached a sample test, the simplified printer and my .gdbinit. I
haven't build kdevelop with debug info here on my work, but this should be
pretty reproducible, you just have to adjust the .gdbinit path to where the
kdevelop printers are on your machine (I've got mine from where I build
kdevelop) and step through gdb on console and print it after the variable
was set.

on console I have:

$6 = "test"

on KDevelop:

{ _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>>
= {<No data fields>}, <No data fields>},  _M_p = 0x80624ec "test"}}



> out of that a simplified debug session using gdb cli and MI commands
> can be created
> that should show the same symptom (the relevant MI commands can be
> found in the kdevelop
> console output).
>
> And then we will see if it's a gdb issue or a kdevelop issue...
>
> Niko
>
> --
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>

Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100513/410d0076/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .gdbinit
Type: application/octet-stream
Size: 514 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100513/410d0076/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cgb_1.py
Type: text/x-python
Size: 2259 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100513/410d0076/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: text/x-c++src
Size: 458 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100513/410d0076/attachment.cpp>


More information about the KDevelop-devel mailing list