This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] fix for avr_skip_prologue()
- From: "Theodore A. Roth" <troth at verinet dot com>
- To: Andrew Cagney <ac131313 at ges dot redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sun, 4 Aug 2002 14:02:06 -0700 (PDT)
- Subject: Re: [RFC] fix for avr_skip_prologue()
On Sun, 4 Aug 2002, Andrew Cagney wrote:
>I don't think your change is any worse than many other *_skip_prologue()
>tweaks. A typical skip_prologue() function is an accumulation of
>heuristics and a lot of comments.
>
<snip>
>> - if (sal.line != 0 && sal.end < func_end)
>> + /* troth/2002-70-19: For some very simple functions, gcc doesn't
>> + generate a prologue and the sal.end ends up being the insn (2 bytes)
>> + before func_end (the address of the next func). By adjusting
>> + func_end, we can catch these functions and return the correct pc. */
>
>I'd just also mention that the instruction in question is ``return'' and
>is two bytes long.
Let's see if I understand what you are saying here. It looks like sal.end
becomes the ``return'' instruction which is 1 insn (2 bytes) before
func_end. If so, it might make more sense for the patch to be
+ if (sal.line != 0 && (sal.end+2) < func_end)
Thus if sal.end is the ``return'' insn for the simple function, we just
return the current pc instead of sal.end.
If that makes any sense to you, I'll fix the comment and commit it.
Ted Roth