This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: question on gdbarch_skip_prologue()
- From: Kevin Buettner <kevinb at redhat dot com>
- To: davidm at hpl dot hp dot com, gdb at sources dot redhat dot com
- Date: Thu, 7 Mar 2002 01:11:17 -0700
- Subject: Re: question on gdbarch_skip_prologue()
- References: <E16irNk-0007hA-00@wailua.hpl.hp.com>
On Mar 6, 10:28pm, David Mosberger wrote:
> I'm exploring the idea of changing the ia64 backend of gdb to use
> unwind information instead of code-reading. While looking into this,
> I started to wonder how gdbarch_skip_prologue() should be implemented.
> Some backends simply return the PC that was passed into the routine,
> i.e., they always assume a zero-size prologue. I'm tempted to do the
> same because I worry that with optimized code, the very notion of a
> prologue becomes quite fuzzy. For example, a prologue might contain a
> branch and, if so, there may not even be a single PC that corresponds
> to the end of the prologue.
>
> Are there any downsides to gdbarch_skip_prologue() always returning
> the original PC? Since the unwind info is accurate no matter what the
> PC is, there are no problems with tracking the contents of preserved
> (callee-saved) registers, but I'm wondering whether I'm missing
> anything else.
GDB currently expects that the skip_prologue() function will return a
PC that's after the last prologue instruction that saved an argument
to its "home" location (if any) in memory (or whereever the debug info
says that a parameter's location is). The difficulty with this, of
course, is that with optimized code, it can be very difficult to
discern where this is.
Kevin