This is the mail archive of the
mailing list for the GDB project.
Re: Relationship between GDB commands in Python and Guile
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Andy Wingo <wingo at igalia dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 17 Mar 2015 12:04:06 +0000
- Subject: Re: Relationship between GDB commands in Python and Guile
- Authentication-results: sourceware.org; auth=none
- References: <87bnkgoki0 dot fsf at igalia dot com>
Andy Wingo <firstname.lastname@example.org> writes:
> "info pretty-printers" won't list pretty-printers that are written in
> Scheme. Likewise for type printers, frame filters, in the future frame
> sniffers, etc etc.
> Is there a story about how this is supposed to work?
> 1. Do nothing, you have to use a Guile API to query and manipulate
> Guile pretty-printers.
> 2. Somehow bake the abstraction of registered pretty printers more
> deeply into GDB, and move the implementation of the command into
> GDB core.
> 3. Somehow bake the abstraction of registered pretty printers more
> deeply into GDB, but still have the command implemented in Python.
> 4. Have Python provide a hooks for each of these commands by which
> Guile could provide it with additional entries. Pretty nasty.
I don't know much about gdb python/guile extension, but I prefer 2.
> An open question would be how to indicate that python extensions win
> over guile extensions. Perhaps we should query extensions by language,
> then, and then list python ones first. Having a unified "priority"
> doesn't make sense in that context. Perhaps the pretty-printing (etc)
> mechanism should, in that case, instead be more fine-grained -- not just
> "try python first", but instead trying the printers (frame filters, etc)
> in order of priority. Perhaps that's too much setup work though; not
> sure what the cost is to "enter" python mode etc.
I'd like to know why is such question raised? In practise, is it common
that users install two pretty-printers, one is python and one is guile?
IMO, extensions by different languages are fair to each other.