This is the mail archive of the gdb@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]

Python pretty-printer trouble


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


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