From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28753 invoked by alias); 22 Apr 2015 19:35:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 28740 invoked by uid 89); 22 Apr 2015 19:35:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,TBC,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mail-ob0-f170.google.com Received: from mail-ob0-f170.google.com (HELO mail-ob0-f170.google.com) (209.85.214.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 22 Apr 2015 19:35:19 +0000 Received: by oblw8 with SMTP id w8so179271481obl.0 for ; Wed, 22 Apr 2015 12:35:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=p3EllAbhj11+KF5+vjGK+0E7/2Pj24TQKfdQzq+uGcs=; b=W2COknzFH5wJUPqeG4HWpZN2gHVVeDzkyuG6s3HEwe6yhw1oY5t1Jxtwv2uIjwyvmb MXUZZsswzZl/1zYxL8W1sbvkPnap/Nf3XVMiJyZN3P4XJK0dZgad4+4OlWW2czdGKw95 MWsSITQuzZcJwIc88ado7GpYob5dWfERyDoOtEXn+Z4tgxDZtQp2hDAbA3W/2m3T5Irl wmXgfTSCjPaeDyt4hF0szjtujtbEkwju4FzidkFMiPcbADju9g8IKvXawB/+zamgo8lw 2mUbFP3nU2aw2DIfiolVfhEhKe5OxH+2dsoOzswK8ja+umG1NpQ10uWsnVbz+R1P5b66 t8pw== X-Gm-Message-State: ALoCoQmnR/jlLz4VvlO4XJSyQEzzs3vtE2S3fJ2pQax145hWx9//qrbDwDOjbL0FvWudm5ZFDHq7 MIME-Version: 1.0 X-Received: by 10.182.105.169 with SMTP id gn9mr21938251obb.28.1429731317511; Wed, 22 Apr 2015 12:35:17 -0700 (PDT) Received: by 10.182.89.99 with HTTP; Wed, 22 Apr 2015 12:35:17 -0700 (PDT) In-Reply-To: <1429637147-5430-1-git-send-email-martin.galvan@tallertechnologies.com> References: <1429637147-5430-1-git-send-email-martin.galvan@tallertechnologies.com> Date: Wed, 22 Apr 2015 19:35:00 -0000 Message-ID: Subject: Re: [PING][PATCH v3] Python API: Fix an exception when registering a global pretty-printer in verbose mode From: Doug Evans To: Martin Galvan Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00838.txt.bz2 On Tue, Apr 21, 2015 at 10:25 AM, Martin Galvan 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 > > * 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