This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix accessing a function's fields (parameters) from Python (PR 18073)
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 21 Oct 2015 15:47:18 -0400
- Subject: Re: [PATCH] Fix accessing a function's fields (parameters) from Python (PR 18073)
- Authentication-results: sourceware.org; auth=none
- References: <1443415430-31110-1-git-send-email-simon dot marchi at polymtl dot ca> <CAFXXi0kOiqOqTKMkaENE6QL5L9kN+KCVkPe0L5J1pCyVCB=1xg at mail dot gmail dot com>
Hi Simon,
> > Since 7.4, gdb doesn't allow calling .fields() on a function type, even
> > though the documentation states it should return a list corresponding to
> > the function's parameters. This patch restores the intended behaviour
> > and adds a test for it.
> >
> > Reg-tested on Arch Linux x86-64.
> >
> > gdb/ChangeLog:
> >
> > PR python/18073
> > * python/py-type.c (typy_get_composite): Allow returning a
> > function type.
> >
> > gdb/testsuite/ChangeLog:
> >
> > PR python/18073
> > * gdb.python/py-type.c (C::a_method): New.
> > (C::a_const_method): New.
> > (C::a_static_method): New.
> > (a_function): New.
> > * gdb.python/py-type.exp (test_fields): Test getting fields
> > from function and method.
The patch looks good to me, although I am not one of the main Python
maintainers. Normally, I'd ask the author to wait an extra week for
additional comments, but since you've already waited a month, I think
it's only fair to give you the go ahead to push. If there are comments
with your code, we can handle them then.
Thanks also adding the tests. You probably know this, but this is
always appreciated.
Thanks!
--
Joel