Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdb pretty printers and python3.x
@ 2013-06-12  9:03 Matthias Klose
  2013-06-12 14:59 ` Paul_Koning
  2013-06-12 15:23 ` David Malcolm
  0 siblings, 2 replies; 3+ messages in thread
From: Matthias Klose @ 2013-06-12  9:03 UTC (permalink / raw)
  To: gdb; +Cc: libstdc++, David Malcolm

Starting with gdb-7.6, gdb supports embedding a Python3 interpreter instead of
Python2.  However most pretty printers are still using Python2 code, and when
shipping a gdb using Python3, you have to fix all pretty printers at once (and
keep building it with Python2, nobody will port to Python3).  So some questions:

 - Is there a list of known pretty printers?  So far I know about
   libstdc++, python, gtk, libreoffice.

 - Is there a minimal python version supported by gdb?  If e.g. it is 2.6,
   then probably most pretty printers could be converted to code which can
   be used by both 2.x and 3.x.  If not, then it would be up to 2to3 runs
   to do the conversion when needed.

 - Has somebody already done such a 3.x based build, and maybe already
   has converted some of the pretty printers?

Thanks, Matthias


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gdb pretty printers and python3.x
  2013-06-12  9:03 gdb pretty printers and python3.x Matthias Klose
@ 2013-06-12 14:59 ` Paul_Koning
  2013-06-12 15:23 ` David Malcolm
  1 sibling, 0 replies; 3+ messages in thread
From: Paul_Koning @ 2013-06-12 14:59 UTC (permalink / raw)
  To: doko; +Cc: gdb, libstdc++, dmalcolm


On Jun 12, 2013, at 5:03 AM, Matthias Klose wrote:

> Starting with gdb-7.6, gdb supports embedding a Python3 interpreter instead of
> Python2.  However most pretty printers are still using Python2 code, and when
> shipping a gdb using Python3, you have to fix all pretty printers at once (and
> keep building it with Python2, nobody will port to Python3).  So some questions:
> 
> - Is there a list of known pretty printers?  So far I know about
>   libstdc++, python, gtk, libreoffice.
> 
> - Is there a minimal python version supported by gdb?  If e.g. it is 2.6,
>   then probably most pretty printers could be converted to code which can
>   be used by both 2.x and 3.x.  If not, then it would be up to 2to3 runs
>   to do the conversion when needed.

The documented minimum is 2.4, I believe.

It's not hard to write code that works both with 2.4 and above, and with 3.x.  The python code that's included with gdb is done that way, including the python section of the test suite.  About the only areas that are a hassle are byte strings (since b"foo" is a syntax error in V2.x) and except clauses that use "except MyException as e".  That second one was discussed on this list yesterday, the answer is simple, it's just not all that elegant.

	paul


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gdb pretty printers and python3.x
  2013-06-12  9:03 gdb pretty printers and python3.x Matthias Klose
  2013-06-12 14:59 ` Paul_Koning
@ 2013-06-12 15:23 ` David Malcolm
  1 sibling, 0 replies; 3+ messages in thread
From: David Malcolm @ 2013-06-12 15:23 UTC (permalink / raw)
  To: Matthias Klose; +Cc: gdb, libstdc++

On Wed, 2013-06-12 at 11:03 +0200, Matthias Klose wrote:
> Starting with gdb-7.6, gdb supports embedding a Python3 interpreter instead of
> Python2.  However most pretty printers are still using Python2 code, and when
> shipping a gdb using Python3, you have to fix all pretty printers at once (and
> keep building it with Python2, nobody will port to Python3).  So some questions:
> 
>  - Is there a list of known pretty printers?  So far I know about
>    libstdc++, python, gtk, libreoffice.

Cython has some too IIRC

Also, it's not just pretty-printers: gdb-heap [1] adds commands to gdb
for dealing with glibc's (and CPython's) handling of the heap.

[...]

Hope this is helpful
Dave

[1] https://fedorahosted.org/gdb-heap/ (my pet project)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-12 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-12  9:03 gdb pretty printers and python3.x Matthias Klose
2013-06-12 14:59 ` Paul_Koning
2013-06-12 15:23 ` David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox