From: Andrew Cagney <ac131313@ges.redhat.com>
To: "Theodore A. Roth" <troth@verinet.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] fix for avr_skip_prologue()
Date: Sun, 04 Aug 2002 17:04:00 -0000 [thread overview]
Message-ID: <3D4DC113.1000700@ges.redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0208041344450.31064-100000@oscar.mynet>
> 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
Yes. that's what I think is happening based on your comments.
> + 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.
Ok.
Andrew
prev parent reply other threads:[~2002-08-05 0:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-19 11:52 Theodore Roth
2002-07-19 12:04 ` Andrew Cagney
2002-08-04 12:43 ` Andrew Cagney
2002-08-04 13:54 ` Theodore A. Roth
2002-08-04 17:04 ` Andrew Cagney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D4DC113.1000700@ges.redhat.com \
--to=ac131313@ges.redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=troth@verinet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox