This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] x86_64_skip_prologue


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]