[PING,v3] Python API: Fix an exception when registering a global pretty-printer in verbose mode
Message ID | 1429637147-5430-1-git-send-email-martin.galvan@tallertechnologies.com |
---|---|
State | New, archived |
Headers |
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: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> 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 <gdb-patches@sourceware.org>; 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 <martin.galvan@tallertechnologies.com> 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> |
Commit Message
Martin Galvan
April 21, 2015, 5:25 p.m. UTC
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 <martin.galvan@tallertechnologies.com> * 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
Comments
On Tue, Apr 21, 2015 at 10:25 AM, Martin Galvan <martin.galvan@tallertechnologies.com> wrote: > 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 <martin.galvan@tallertechnologies.com> > > * 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(-) > > 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"): Hi. Looking at the code again I found a couple more issues, so I fixed those too and wrote a testcase. https://sourceware.org/ml/gdb-patches/2015-04/msg00837.html
That's great. Thanks a lot! On Wed, Apr 22, 2015 at 4:35 PM, Doug Evans <dje@google.com> wrote: > On Tue, Apr 21, 2015 at 10:25 AM, Martin Galvan > <martin.galvan@tallertechnologies.com> wrote: >> 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 <martin.galvan@tallertechnologies.com> >> >> * 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(-) >> >> 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"): > > Hi. > Looking at the code again I found a couple more issues, > so I fixed those too and wrote a testcase. > > https://sourceware.org/ml/gdb-patches/2015-04/msg00837.html
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"):