public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] Python API: Fix an exception when registering a global pretty-printer in verbose mode
@ 2015-03-11 18:17 Martin Galvan
  2015-03-11 23:52 ` Doug Evans
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Galvan @ 2015-03-11 18:17 UTC (permalink / raw)
  To: gdb-patches, dje

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.

Changes from v1:
 * Moved printer.name to the next line so that it won't break the 80 character limit.

--

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..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"):

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] Python API: Fix an exception when registering a global pretty-printer in verbose mode
  2015-03-11 18:17 [PATCH v2] Python API: Fix an exception when registering a global pretty-printer in verbose mode Martin Galvan
@ 2015-03-11 23:52 ` Doug Evans
  2015-03-12  0:25   ` Martin Galvan
  2015-03-28 20:40   ` Martin Galvan
  0 siblings, 2 replies; 7+ messages in thread
From: Doug Evans @ 2015-03-11 23:52 UTC (permalink / raw)
  To: Martin Galvan; +Cc: gdb-patches

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 patch 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 character limit.
 > 
 > --
 > 
 > 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..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"):

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  <martin.galvan@tallertechnologies.com>

	* python/lib/gdb/printing.py (register_pretty_printer): Fix exception
	when registering a global pretty-printer in verbose mode.

No need to repost though.
Ok to commit with that fixed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] Python API: Fix an exception when registering a global pretty-printer in verbose mode
  2015-03-11 23:52 ` Doug Evans
@ 2015-03-12  0:25   ` Martin Galvan
  2015-03-28 20:40   ` Martin Galvan
  1 sibling, 0 replies; 7+ messages in thread
From: Martin Galvan @ 2015-03-12  0:25 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

On Wed, Mar 11, 2015 at 8:52 PM, Doug Evans <dje@google.com> wrote:
> 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  <martin.galvan@tallertechnologies.com>
>
>         * python/lib/gdb/printing.py (register_pretty_printer): Fix exception
>         when registering a global pretty-printer in verbose mode.
>
> No need to repost though.
> Ok to commit with that fixed.

Thanks a lot! I'll keep that in mind for any future patches.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] Python API: Fix an exception when registering a global pretty-printer in verbose mode
  2015-03-11 23:52 ` Doug Evans
  2015-03-12  0:25   ` Martin Galvan
@ 2015-03-28 20:40   ` Martin Galvan
  2016-01-01 11:33     ` Joel Brobecker
  1 sibling, 1 reply; 7+ messages in thread
From: Martin Galvan @ 2015-03-28 20:40 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

On Wed, Mar 11, 2015 at 8:52 PM, Doug Evans <dje@google.com> 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 patch 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 character limit.
>  >
>  > --
>  >
>  > 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..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"):
>
> 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  <martin.galvan@tallertechnologies.com>
>
>         * python/lib/gdb/printing.py (register_pretty_printer): Fix exception
>         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!

-- 

Martin Galvan

Software Engineer

Taller Technologies Argentina

San Lorenzo 47, 3rd Floor, Office 5

Córdoba, Argentina

Phone: 54 351 4217888 / +54 351 4218211

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] Python API: Fix an exception when registering a global pretty-printer in verbose mode
  2015-03-28 20:40   ` Martin Galvan
@ 2016-01-01 11:33     ` Joel Brobecker
  2016-01-02  1:09       ` Martin Galvan
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2016-01-01 11:33 UTC (permalink / raw)
  To: Martin Galvan; +Cc: Doug Evans, gdb-patches

> > 2015-03-11  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.
> >
> > 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?

Martin - I am going through my gdb-patches mailbox, and I am wondering
if anyone pushed that patch for you? If not, would you mind rebasing
your patch and sending it to us, please (with our sincerest apologies!)?

-- 
Joel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] Python API: Fix an exception when registering a global pretty-printer in verbose mode
  2016-01-01 11:33     ` Joel Brobecker
@ 2016-01-02  1:09       ` Martin Galvan
  2016-01-02  2:46         ` Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Galvan @ 2016-01-02  1:09 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Doug Evans, gdb-patches

On Fri, Jan 1, 2016 at 8:32 AM, Joel Brobecker <brobecker@adacore.com> wrote:
> Martin - I am going through my gdb-patches mailbox, and I am wondering
> if anyone pushed that patch for you? If not, would you mind rebasing
> your patch and sending it to us, please (with our sincerest apologies!)?
>
> --
> Joel

Hi! Thanks a lot for writing. I honestly don't remember what happened
to this patch :) however looking at the git master it seems that it's
fixed already. In any case, I now have commit-after-approval access,
so I'll test it next week and commit it myself if it's still breaking.

Again, thanks a lot and happy new year!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] Python API: Fix an exception when registering a global pretty-printer in verbose mode
  2016-01-02  1:09       ` Martin Galvan
@ 2016-01-02  2:46         ` Joel Brobecker
  0 siblings, 0 replies; 7+ messages in thread
From: Joel Brobecker @ 2016-01-02  2:46 UTC (permalink / raw)
  To: Martin Galvan; +Cc: Doug Evans, gdb-patches

> Hi! Thanks a lot for writing. I honestly don't remember what happened
> to this patch :) however looking at the git master it seems that it's
> fixed already. In any case, I now have commit-after-approval access,
> so I'll test it next week and commit it myself if it's still breaking.

Ah, even better! :)

> Again, thanks a lot and happy new year!

You are very welcome. Happy New Year to you too :).

-- 
Joel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-02  2:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11 18:17 [PATCH v2] Python API: Fix an exception when registering a global pretty-printer in verbose mode Martin Galvan
2015-03-11 23:52 ` Doug Evans
2015-03-12  0:25   ` Martin Galvan
2015-03-28 20:40   ` Martin Galvan
2016-01-01 11:33     ` Joel Brobecker
2016-01-02  1:09       ` Martin Galvan
2016-01-02  2:46         ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).