* [PING][PATCH v3] Python API: Fix an exception when registering a global pretty-printer in verbose mode
@ 2015-04-21 17:26 Martin Galvan
2015-04-22 19:35 ` Doug Evans
0 siblings, 1 reply; 3+ messages in thread
From: Martin Galvan @ 2015-04-21 17:26 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
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"):
--
2.3.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PING][PATCH v3] Python API: Fix an exception when registering a global pretty-printer in verbose mode
2015-04-21 17:26 [PING][PATCH v3] Python API: Fix an exception when registering a global pretty-printer in verbose mode Martin Galvan
@ 2015-04-22 19:35 ` Doug Evans
2015-04-22 19:36 ` Martin Galvan
0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2015-04-22 19:35 UTC (permalink / raw)
To: Martin Galvan; +Cc: gdb-patches
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PING][PATCH v3] Python API: Fix an exception when registering a global pretty-printer in verbose mode
2015-04-22 19:35 ` Doug Evans
@ 2015-04-22 19:36 ` Martin Galvan
0 siblings, 0 replies; 3+ messages in thread
From: Martin Galvan @ 2015-04-22 19:36 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
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
--
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] 3+ messages in thread
end of thread, other threads:[~2015-04-22 19:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-21 17:26 [PING][PATCH v3] Python API: Fix an exception when registering a global pretty-printer in verbose mode Martin Galvan
2015-04-22 19:35 ` Doug Evans
2015-04-22 19:36 ` Martin Galvan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox