This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 1/2] Fix some error-handling bugs in python frame filters
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org, Matthias Klose <doko at ubuntu dot com>
- Date: Tue, 8 Nov 2016 13:07:11 +0000
- Subject: Re: [RFA 1/2] Fix some error-handling bugs in python frame filters
- Authentication-results: sourceware.org; auth=none
- References: <1477951905-14880-1-git-send-email-tom@tromey.com> <1477951905-14880-2-git-send-email-tom@tromey.com> <87y4105g42.fsf@tromey.com>
On 11/03/2016 10:54 PM, Tom Tromey wrote:
> Fix some error-handling bugs in python frame filters
>
> While writing a Python frame filter, I found a few bugs in the current
> frame filter code. In particular:
>
> * One spot converts a Python long to a CORE_ADDR using PyLong_AsLong.
> However, this can fail on overflow. I changed this to use
> get_addr_from_python.
>
> * Another spot is doing the same but with PyLong_AsUnsignedLongLong; I
> changed this as well just for consistency.
Ah, I wondered about this at:
https://sourceware.org/ml/gdb-patches/2016-10/msg00041.html
Your patch obsoletes Matthias' then.
>
> * Converting line numbers can print "-1" if conversion from long
> fails. This isn't fatal but just a bit ugly.
>
> I've included a test case for the first issue. The line number one
> didn't seem important enough to bother with.
>
> 2016-10-31 Tom Tromey <tom@tromey.com>
>
> * python/py-framefilter.c (py_print_frame): Use
> get_addr_from_python. Check for errors when getting line number.
>
> 2016-10-31 Tom Tromey <tom@tromey.com>
>
> * gdb.python/py-framefilter.py (ElidingFrameDecorator.address):
> New method.
>
Great, LGTM.
Thanks,
Pedro Alves