This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/16050] New: Provide a standard way to register pretty printers by class name


https://sourceware.org/bugzilla/show_bug.cgi?id=16050

            Bug ID: 16050
           Summary: Provide a standard way to register pretty printers by
                    class name
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: b.r.longbons at gmail dot com

Currently pretty printers are looked up by iterating over
objfile.pretty_printers and calling the function objects until one.

In the vast majority of cases, the user really wants is to just look up the
printer based on the current type's name.

I propose that each objfile have an attribute fast_pretty_printers, and that
the first entry in the existing pretty_printers list be a printer that tries
the fast_pretty_printers. I am ignoring the global printer list because you
really shouldn't use it.

The actual printer could be written entirely in python, but Objfile needs to
add the attribute.

fast_pretty_printers would be a dict from the current type's name after
following typedefs and cutting off all template arguments, to a python function
(usually a class) that takes a gdb.Value as its argument.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]