From patchwork Tue Apr 21 17:25:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Galvan X-Patchwork-Id: 6347 Received: (qmail 60750 invoked by alias); 21 Apr 2015 17:26:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 60589 invoked by uid 89); 21 Apr 2015 17:25:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_SOFTFAIL, TBC autolearn=no version=3.3.2 X-HELO: mail-qg0-f45.google.com Received: from mail-qg0-f45.google.com (HELO mail-qg0-f45.google.com) (209.85.192.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 21 Apr 2015 17:25:57 +0000 Received: by qgfi89 with SMTP id i89so71524024qgf.1 for ; Tue, 21 Apr 2015 10:25:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=vczSukL+CHcTzB/JR9b3GDjuBCae21ro3eWG6VJ9PQ0=; b=laxj9i5rMlV+8ELNNwI6ZJdFWHr9qmI/Fcxb9eJ5tVU08iXHwwwk7OtP6ESOUbSZX6 di2lRMVJxbfV290YtthwDwiPu4pBmxgytl9QVs9c1ThVf1tMjp1HqJ46T0mft0z0uFDP 6Ndtt4IekPZ12HvQ7UFw11sF4+MP2sH5g1CPTj3u+ffihtaSXjDZdu9jyZ6wjQE4PNcu CLT9QNvmTS5lBk3idXU/1rqmdar3cLwP/MXKS4odAD2dUKODd4zIUXplzUnbvhr42/Uj cJIs2Md3ewtyZnFzmYhxU2qGBgGa5HLH26TbiuOXFPT/HIjSK7bVepJcxB4iCrFOqFD8 qcsQ== X-Gm-Message-State: ALoCoQm5PT2vAnI9xAGeOuz7mMXi6d8F+y6o0L268cNQkUtNEVyAe44M1t/FASmkr4ygQjck7oMt X-Received: by 10.140.89.37 with SMTP id u34mr24371599qgd.15.1429637154565; Tue, 21 Apr 2015 10:25:54 -0700 (PDT) Received: from martin-galvan.dominio.tallertechnologies.com ([200.69.202.173]) by mx.google.com with ESMTPSA id f35sm1806852qga.10.2015.04.21.10.25.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Apr 2015 10:25:53 -0700 (PDT) From: Martin Galvan To: gdb-patches@sourceware.org, dje@google.com Subject: [PING][PATCH v3] Python API: Fix an exception when registering a global pretty-printer in verbose mode Date: Tue, 21 Apr 2015 14:25:47 -0300 Message-Id: <1429637147-5430-1-git-send-email-martin.galvan@tallertechnologies.com> 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 This patch was previously accepted by Doug Evans (https://sourceware.org/ml/gdb-patches/2015-03/msg00312.html), but it was never committed. I have a company-wide copyright assignment for gdb. I don't have commit access though, so it would be great if anyone could commit this for me. Thanks a lot! Chamges in v3: * Added the function name to the ChangeLog entry, and wrapped it at 80 characters. Changes in v2: * Moved printer.name to the next line so that it won't break the 80 character limit. --- ChangeLog: gdb/ 2015-04-16 Martin Galvan * python/lib/gdb/printing.py (register_pretty_printer): Fix exception when registering a global pretty-printer in verbose mode. --- gdb/python/lib/gdb/printing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.3.5 diff --git a/gdb/python/lib/gdb/printing.py b/gdb/python/lib/gdb/printing.py index e384e41..c935333 100644 --- a/gdb/python/lib/gdb/printing.py +++ b/gdb/python/lib/gdb/printing.py @@ -116,7 +116,8 @@ 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"):