help with pretty printing

Joachim Protze joachim.protze@tu-dresden.de
Thu Jun 7 07:42:00 GMT 2012


On 01.06.2012 11:07, somersetgraham wrote:
> def build_dictionary ():
>     pretty_printers_dict[re.compile ('^QFile$')] = lambda
> val:QFilePrinter(val)
>     pretty_printers_dict[re.compile ('^QFile *$')] = lambda
> val:QFilePrinter(val)
you may try something like the following to match both cases:

pretty_printers_dict[re.compile('^QFile ( \*)?$')] = lambda
val:QFilePrinter(val)


The asterisk is a special character in regular expressions and has to be escaped to match an asterisk. Your regexp matches QFile with any count of spaces as postfix.

- Joachim


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5306 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://sourceware.org/pipermail/gdb/attachments/20120607/ed775d3a/attachment.p7s>


More information about the Gdb mailing list