This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING][RFC][PATCH v2] Python API: add gdb.stack_may_be_invalid
- From: Martin Galvan <martin dot galvan at tallertechnologies dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org, Doug Evans <dje at google dot com>, Eli Zaretskii <eliz at gnu dot org>, Pedro Alves <palves at redhat dot com>, Daniel Gutson <daniel dot gutson at tallertechnologies dot com>
- Date: Fri, 7 Nov 2014 14:36:56 -0300
- Subject: Re: [PING][RFC][PATCH v2] Python API: add gdb.stack_may_be_invalid
- Authentication-results: sourceware.org; auth=none
- References: <CAOKbPbZd+ppseGQW2OirBm4y5O=LgUMP-Pf8=RF00hnPOuMutw at mail dot gmail dot com> <201411071727 dot sA7HRNIQ007851 at d03av02 dot boulder dot ibm dot com>
On Fri, Nov 7, 2014 at 2:27 PM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
> Martin Galvan wrote:
>
>> +stack_is_destroyed (gdb_py_ulongest pc)
>> +{
>> + return gdbarch_in_function_epilogue_p (python_gdbarch, pc);
>> +}
>
> Just one comment here: python_gdbarch isn't really correct here.
> If you have a platform that supports multiple architectures, then
> you really should use the appropriate gdbarch for PC.
Agreed. I used python_gdbarch because it's used all over the API, so I
thought I could use it in here.
> Ideally, the Python interface should carry enough information to
> determine the appropriate gdbarch, e.g. by operating on a Frame
> instead of a plain PC value.
If I understand correctly, using a Frame would require the program to
be already running by the time we call the API function, which isn't
really what we want.
> If that isn't possible, one fall-back might be to look up the
> symbol table from the PC, and use the associated objfile arch.
I'll look into this. Thanks a lot!
--
MartÃn GalvÃn
Software Engineer
Taller Technologies Argentina
San Lorenzo 47, 3rd Floor, Office 5
CÃrdoba, Argentina
Phone: 54 351 4217888 / +54 351 4218211