This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] x86_64_skip_prologue
- From: Kevin Buettner <kevinb at redhat dot com>
- To: Michal Ludvig <mludvig at suse dot cz>, gdb-patches at sources dot redhat dot com
- Date: Fri, 15 Mar 2002 11:40:51 -0700
- Subject: Re: [RFA] x86_64_skip_prologue
- References: <3C923BD9.80403@suse.cz>
On Mar 15, 7:22pm, Michal Ludvig wrote:
> I have written a new x86_64_skip_prologue() function. The approach is,
> 1) Detect, wherher the function seems to have a prolog (ie. starts with
> instructions push %rbp and mov %rsp,%rbp). If not, return pc and exit.
> 2) Try to get debuginfo. If not, just return pc.
> 3) Now pc points to the first line of the sourcecode of the function
> (usually opening '{'). If the next line with debuginfo has pc within
> bounds of this function, we will return this pc instead.
You might want to take a look at some of the other prologue analyzers.
In particular, you might want to consider calling find_pc_line() instead
of accessing the data structures directly.
> Anyway I'm not sure, wherher the lines in linetab _must_ grow up
> monotonically (I assume so).
I believe it can be non-monotonic for optimized code.
BTW, you might want to run your code through indent.
Kevin