public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/13465] New: typecasting in gdb python pretty-printer
@ 2011-12-01 19:53 eric at anholt dot net
  2011-12-01 20:26 ` [Bug gdb/13465] " tromey at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: eric at anholt dot net @ 2011-12-01 19:53 UTC (permalink / raw)
  To: gdb-prs

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.


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

end of thread, other threads:[~2012-02-07 16:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-01 19:53 [Bug gdb/13465] New: typecasting in gdb python pretty-printer eric at anholt dot net
2011-12-01 20:26 ` [Bug gdb/13465] " tromey at redhat dot com
2011-12-02 12:14 ` pedro at codesourcery dot com
2011-12-14 16:29 ` dje at google dot com
2012-02-07 16:01 ` [Bug python/13465] " tromey at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).