Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Haupt <michael.haupt@oracle.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Python pretty-printer trouble
Date: Mon, 22 Apr 2013 12:49:00 -0000	[thread overview]
Message-ID: <02C07AA4-ED67-4725-94A9-CAD82D624420@oracle.com> (raw)

Hello,

using gdb 7.5 on Mac OS X, I am registering a pretty-printer written in Python, which won't be triggered. The pretty-printer is supposed to take care of values of type <something>_array.

class MyPP:
    def __init__(self, val):
        self.val = val
    def to_string(self):
        return 'This is an array of sorts.'

pp = gdb.printing.RegexpCollectionPrettyPrinter('my_array_pp')
pp.add_printer('arrays', '^.*_array', MyPP)
gdb.printing.register_pretty_printer(None, pp)

The pretty-printer is registered correctly but will not be triggered when values of a type the name of which matches the pattern are to be printed. I've read my way through the available documentation at sourceware.org and still have no clue. By now, I'm sure I'm missing something obvious.

Any hints?

Regards,

Michael Haupt

-- 
Dr. Michael Haupt
Principal Member of Technical Staff
Phone: +49 331 200 7277, Fax: +49 331 200 7561
Oracle Labs
Oracle Deutschland B.V. & Co. KG, Schiffbauergasse 14, 14467 Potsdam, Germany


             reply	other threads:[~2013-04-22 12:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-22 12:49 Michael Haupt [this message]
2013-04-22 15:30 ` Michael Haupt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=02C07AA4-ED67-4725-94A9-CAD82D624420@oracle.com \
    --to=michael.haupt@oracle.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox