This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Python API: Fix an exception when registering a global pretty-printer in verbose mode
- From: Martin Galvan <martin dot galvan at tallertechnologies dot com>
- To: gdb-patches at sourceware dot org, dje at google dot com
- Date: Wed, 11 Mar 2015 14:36:57 -0300
- Subject: [PATCH] Python API: Fix an exception when registering a global pretty-printer in verbose mode
- Authentication-results: sourceware.org; auth=none
This patch fixes a Python exception that was being thrown when trying to register a global pretty-printer with verbose mode on:
File "/usr/share/gdb/python/gdb/printing.py", line 119, in register_pretty_printer
gdb.write("Registering global %s pretty-printer ...\n" % name)
NameError: name 'name' is not defined
My copyright assignment is on the works, but since this is a small patch I don't think it's necessary.
--
Changelog:
2015-03-11 Martin Galvan <martin.galvan@tallertechnologies.com>
* python/lib/gdb/printing.py: Fix exception when registering a global pretty-printer in verbose mode.
diff --git a/gdb/python/lib/gdb/printing.py b/gdb2/python/lib/gdb/printing.py
index 47742a9..7fa4532 100644
--- a/gdb/python/lib/gdb/printing.py
+++ b/gdb/python/lib/gdb/printing.py
@@ -116,7 +116,7 @@ def register_pretty_printer(obj, printer, replace=False):
if obj is None:
if gdb.parameter("verbose"):
- gdb.write("Registering global %s pretty-printer ...\n" % name)
+ gdb.write("Registering global %s pretty-printer ...\n" % printer.name)
obj = gdb
else:
if gdb.parameter("verbose"):