From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13238 invoked by alias); 28 Mar 2015 20:40:40 -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 13224 invoked by uid 89); 28 Mar 2015 20:40:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mail-la0-f51.google.com Received: from mail-la0-f51.google.com (HELO mail-la0-f51.google.com) (209.85.215.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 28 Mar 2015 20:40:38 +0000 Received: by lagg8 with SMTP id g8so92921153lag.1 for ; Sat, 28 Mar 2015 13:40:34 -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:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=USv1xLD7o2CYqiyp4Qr9+Ogima7WLdXZzmgkopNvbSQ=; b=A+GUUIL+x6P9lsB1cXhRFscdmi9un1iG9cuL4NqhQNpRuKlPo3OvuBZbYhYVxRq51A Tw34/y5IrixwTj0eGtSfNArqz0ucIuzKWPC0EpoyPpkJbh45k31EBvUmDLULyIzLA0k3 yqPwGIGlypREjChiSr2SOagpSDpdOnILZXyD6NS8DTzWSSPcfGVE0dtXXL8HWBpYAo95 LO8H9Bz8lwfZksKeYpec3EePFm6ie4Ew8/VlUZAeTIBxob/gN74Z2/GNIwdyh259SGBz 7mhA4D5V58Akb56nXoJTYRe84z4doEX0infjgnULonybMhJkXAp57ZEFtBxlAmeNbSgX TD6g== X-Gm-Message-State: ALoCoQko8I1kOQwJgJtUVPC2BtLKyL95tlcnrI2xRAJAzbNLbjqGpjsdIbsiPijHCTMzYXzKrKpz X-Received: by 10.112.132.35 with SMTP id or3mr10950875lbb.85.1427575234693; Sat, 28 Mar 2015 13:40:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.52.42 with HTTP; Sat, 28 Mar 2015 13:39:54 -0700 (PDT) In-Reply-To: <21760.54598.126480.383468@ruffy2.mtv.corp.google.com> References: <1426097817-30955-1-git-send-email-martin.galvan@tallertechnologies.com> <21760.54598.126480.383468@ruffy2.mtv.corp.google.com> From: Martin Galvan Date: Sat, 28 Mar 2015 20:40:00 -0000 Message-ID: Subject: Re: [PATCH v2] Python API: Fix an exception when registering a global pretty-printer in verbose mode To: Doug Evans Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-03/txt/msg00948.txt.bz2 On Wed, Mar 11, 2015 at 8:52 PM, Doug Evans wrote: > Martin Galvan writes: > > 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 pat= ch I don't think it's necessary. > > > > Changes from v1: > > * Moved printer.name to the next line so that it won't break the 80 c= haracter limit. > > > > -- > > > > Changelog: > > > > 2015-03-11 Martin Galvan > > > > * python/lib/gdb/printing.py: Fix exception when registering a gl= obal pretty-printer in verbose mode. > > > > diff --git a/gdb/python/lib/gdb/printing.py b/gdb2/python/lib/gdb/prin= ting.py > > index 47742a9..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= =3DFalse): > > > > 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 =3D gdb > > else: > > if gdb.parameter("verbose"): > > LGTM, with two more nits. > The ChangeLog entry > 80 char limit :-), > and convention is to include the function name in the ChangeLog entry. > > E.g., > > 2015-03-11 Martin Galvan > > * python/lib/gdb/printing.py (register_pretty_printer): Fix excep= tion > when registering a global pretty-printer in verbose mode. > > No need to repost though. > Ok to commit with that fixed. Sorry to bother, but I don't have write privileges on the repository; would you be so kind to commit this for me? Thanks a lot! --=20 Martin Galvan Software Engineer Taller Technologies Argentina San Lorenzo 47, 3rd Floor, Office 5 C=C3=B3rdoba, Argentina Phone: 54 351 4217888 / +54 351 4218211