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 gdb/13465] New: typecasting in gdb python pretty-printer


http://sourceware.org/bugzilla/show_bug.cgi?id=13465

             Bug #: 13465
           Summary: typecasting in gdb python pretty-printer
           Product: gdb
           Version: 7.3
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: eric@anholt.net
    Classification: Unclassified


Context:

In Mesa graphics drivers implemented in C, there are these Mesa core types
(struct gl_texture_object, struct gl_texture_image), which each driver creates
"subclasses" of by embedding that struct in their own struct as:

struct intel_texture_image {
  struct gl_texture_image base;
  struct intel_mipmap_tree *mt;
}

When debugging Mesa, we often have a pointer to a base type like struct
gl_texture_image, so to print the information we always want to see we have to
p *(struct intel_context *)tex_image.

What I want:

I'd like to be able to implement a python pretty-printer autoloaded based on my
driver's object file that can make a decision about what type to print one of
these base types as (either by looking at vtbl-like information in some
objects, or just by knowing that if you've got i965_dri.so loaded, every struct
gl_texture_image is a struct intel_texture_image).  However, I'm told that
there isn't a way to do that today:

<tromey> so, we don't have a value-replacement facility
<tromey> that might be a nice addition
<xdje> replace the value where?
<tromey> he basically wants something like 'set print object on', that works
for his particular C case
<tromey> based on knowledge of his program
<tromey> without writing a full printer for the enclosing struct

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]