This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Python API: Add gdb.is_in_prologue and gdb.is_in_epilogue.
- From: Doug Evans <dje at google dot com>
- To: Daniel Gutson <daniel dot gutson at tallertechnologies dot com>
- Cc: Martin Galvan <martin dot galvan at tallertechnologies dot com>, Ulrich Weigand <uweigand at de dot ibm dot com>, Pedro Alves <palves at redhat dot com>, gdb-patches <gdb-patches at sourceware dot org>, Eli Zaretskii <eliz at gnu dot org>
- Date: Thu, 23 Oct 2014 19:42:13 -0700
- Subject: Re: [PATCH] Python API: Add gdb.is_in_prologue and gdb.is_in_epilogue.
- Authentication-results: sourceware.org; auth=none
- References: <CAOKbPbZJfQYmGk9PyQ2C7Y-hat-KxfvR-pC4sNHpF4_zdarRfQ at mail dot gmail dot com> <201410231757 dot s9NHvX3r026780 at d06av02 dot portsmouth dot uk dot ibm dot com> <CAOKbPbZQEKeoqAoi9YEnj0spDOrVxKAdBSuY_NM-jgZ1D3LC=g at mail dot gmail dot com> <CAF5HaEXXWLY4=K0Gox-b8Kwkp408QnyujkiTTpT8h=ryyAxuCQ at mail dot gmail dot com>
On Thu, Oct 23, 2014 at 11:13 AM, Daniel Gutson
<daniel.gutson@tallertechnologies.com> wrote:
> On Thu, Oct 23, 2014 at 3:09 PM, Martin Galvan
> <martin.galvan@tallertechnologies.com> wrote:
>> On Thu, Oct 23, 2014 at 2:57 PM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
>>> The fundamental problem is that the notion of "prologue" and "epilogue"
>>> simply no longer exists in optimized code generated by modern compilers;
>>> and even more compiler features get implemented that make those notions
>>> even less useful (e.g. shrink-wrapping).
>>>
>>> As a result, we have been trying to the rid of using those notions as
>>> much as possible; for example, when debugging optimized code with modern
>>> DWARF information present, GDB will today no longer even use prologue
>>> skipping at all. Instead, the debug information is good enough that
>>> the correct location of local variables can be recovered at every
>>> instruction in the function, making the distinction no longer needed.
>>>
>>> The in_prologue routine is likewise only still uses under certain rather
>>> rare circumstances; in fact it might even today be possible to simply
>>> remove it. Once more platforms provide correct DWARF covering epilogues
>>> as well, the gdbarch_in_function_epilogue_p calls in breakpoint.c may
>>> likewise become unnecessary.
>>>
>>> So if we hope at some point to get rid of those routines, then it seems
>>> counterproductive to now export them as part of a fixed external API ...
>>
>> While that may be true, it's also true that at some points we still
>> see the local variables having wrong values when stepping through
>> machine code. The aim of this patch is to expose a way of detecting
>> such situations for scripts that may need it. Until we have a safer
>> way to do it I think this should be integrated to the code base.
>
> Hi all,
> (Hi Pedro!)
>
> we badly need this. If you think the patch is in a shape good enough
> to be committed, please commit it for MartÃn since he doesn't have
> write access.
>
> We can then start a fresh new thread to discuss future directions
> specially related to optimized code and exactly what/how DWARF
> tags should be handled.
Ulrich raises a valid point though.
API design needs to be done with care.
I'd rather not rush this.