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

[commit] Fix disable/enable pretty-printer, subprinter handling.


Hi.

fyi, I checked this in.
printer.subprinters is None by default.

2010-11-10  Doug Evans  <dje@google.com>

	* python/lib/gdb/command/pretty_printers.py
	(do_enable_pretty_printer_1): Handle printer.subprinters is None.

Index: python/lib/gdb/command/pretty_printers.py
===================================================================
RCS file: /cvs/src/src/gdb/python/lib/gdb/command/pretty_printers.py,v
retrieving revision 1.1
diff -u -p -r1.1 pretty_printers.py
--- python/lib/gdb/command/pretty_printers.py	2 Nov 2010 22:44:13 -0000	1.1
+++ python/lib/gdb/command/pretty_printers.py	10 Nov 2010 23:43:37 -0000
@@ -240,7 +240,8 @@ def do_enable_pretty_printer_1 (pretty_p
     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:


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