Hello,
> On Sunday 21 March 2010 19:40:45 ext Alex Richardson wrote:
> > Hello,
> > 
> > is it possible to use the gdbmacros.py/dumper.py with GDB (without
> > QtCreator)?
> 
> The code in the gdbmacros.py/dumper.py is geared towards producing
> whatever is useful to Qt Creator, including some ad-hoc data compression
> and encoding that makes the output probably not too useful without
> using some "client code" very similar to Creator's debugger plugin.
> 
> However, gdb itself has a way to "pretty print" structures using Python.
> This is probably the best starting point if you don't want to use Qt
> Creator.
> 
> You might be able to "re-use ideas" from gdbmacros.py, but the syntax is
> fairly different, so at least on the surface this would be a
> re-implementation.
Yes, I just had a look at the GDB documentation and it seems I would have to 
change quite a bit.
It seems the output field in the dumper class would be useful to implement the 
to_string method, 
however I'd still need to add children() and display_hint().
I'll learn some Python and try creating pretty-printers based on the 
gdbmacros.py

> > If so I would be highly interested in finding out how to achieve that.
> > 
> > I hope some editing of .gdbinit would be enough, but i suspect that won't
> > suffice.
> 
> Just running  "python execfile('..../dumper.py')" is certainly possible,
> but you'd still need to interpret the output or replace the output
> generation by something that fits your needs better.
> 
> Maybe it is possible to give more detailed advice if we know what you try
> to accomplish exactly.
What I'm trying to achive is basically that I can type "print $any_qt_type" in 
gdb and I get some 
useful output. This would also be useful when using Eclipse (I can't always use 
QtCreator) since 
Eclipse relies on the default GDB output (which would be way more useful with 
pretty-printing).


Alex
_______________________________________________
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator

Reply via email to