From f61a2da754809850edb88aa1c5658d8015f8fc37 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Wed, 10 Nov 2010 23:44:14 +0000 Subject: [PATCH] * python/lib/gdb/command/pretty_printers.py (do_enable_pretty_printer_1): Handle printer.subprinters is None. --- gdb/ChangeLog | 3 +++ gdb/python/lib/gdb/command/pretty_printers.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e458c4248c..8c8a5bdf3f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ 2010-11-10 Doug Evans + * python/lib/gdb/command/pretty_printers.py + (do_enable_pretty_printer_1): Handle printer.subprinters is None. + * value.c (set_value_enclosing_type): Renamed from value_change_enclosing_type. All callers updated. * value.h (set_value_enclosing_type): Update. diff --git a/gdb/python/lib/gdb/command/pretty_printers.py b/gdb/python/lib/gdb/command/pretty_printers.py index 4e341a57e6..58a639aabd 100644 --- a/gdb/python/lib/gdb/command/pretty_printers.py +++ b/gdb/python/lib/gdb/command/pretty_printers.py @@ -240,7 +240,8 @@ def do_enable_pretty_printer_1 (pretty_printers, name_re, subname_re, flag): for printer in pretty_printers: if (hasattr(printer, "name") and name_re.match(printer.name) or hasattr(printer, "__name__") and name_re.match(printer.__name__)): - if hasattr(printer, "subprinters"): + if (hasattr(printer, "subprinters") and + printer.subprinters is not None): if not subname_re: # Only record printers that change state. if printer_enabled_p(printer) != flag: