public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Petr Hluzín" <petr.hluzin@gmail.com>
To: Richard Henderson <rth@redhat.com>
Cc: Anitha Boyapati <anitha.boyapati@gmail.com>,
	binutils@sourceware.org, gdb@sourceware.org,
		GCC Patches <gcc-patches@gcc.gnu.org>,
	chertykov@gmail.com, aesok@post.ru, 	eric.weddington@atmel.com
Subject: Re: [avr] gas support for cfi info
Date: Wed, 16 Feb 2011 22:49:00 -0000	[thread overview]
Message-ID: <AANLkTimf0+YtnhES6AZyY75zjYHu_Gkh_M+dJo4N7mUx@mail.gmail.com> (raw)
In-Reply-To: <4D5C104D.7050707@redhat.com>

On 16 February 2011 18:58, Richard Henderson <rth@redhat.com> wrote:
> Anitha pointed out to me via gcc pr17994 that AVR uses post-decrement
> for its pushes.  I had a brief read over the AVR insn manual, and it's
> not crystal clear how multi-byte post-decrement pushes operate.
>
> I've made an assumption that it happens as-if each byte is pushed
> separately.  I.e.
>
>  caller:           callee:
>    save rN
>    save rM
>    trash    <- SP  hi(ret)  <- CFA
>                    lo(ret)
>                    trash    <- SP
>
> This is the only way I can imagine that call insns interoperate with
> byte push/pop insns.

Yes, except the bytes of return address are in big-endian. See
avr-tdep.c in function avr_frame_prev_register():
/* ...
And to confuse matters even more, the return address stored
on the stack is in big endian byte order, even though most
everything else about the avr is little endian. Ick!  */

> All of which means that the return address is at a different offset
> from the CFA than I originally thought.  This ought to be fixed in
> the following.
>
> Can someone please test these two patches and see if they actually
> agree with the hardware?

What should I look for when testing?
The layout of stack you draw is correct (minus the endianity), see avr-tdep.c:
/* Any function with a frame looks like this ...

-- 
Petr Hluzin

  reply	other threads:[~2011-02-16 22:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTim6hyXysiV-025BDgNJ84qaqTnkRdHi+e7bF2gx@mail.gmail.com>
     [not found] ` <AANLkTi=Rnu-wb2W8FejN=XQHmHuTq7rZovKuDdO-QLwi@mail.gmail.com>
     [not found]   ` <AANLkTimOXF1V__SSFs1gtqJh5nc183EdeHm5NoeU6YXs@mail.gmail.com>
     [not found]     ` <AANLkTike2osnZS=sUphuN_=oFQLCDUs54uuGCWL6cLVQ@mail.gmail.com>
2011-02-15 17:41       ` Testing Call frame information in .debug_frame section Richard Henderson
2011-02-15 18:02         ` Richard Henderson
2011-02-15 22:13           ` Petr Hluzín
2011-02-16 16:51             ` Richard Henderson
2011-02-15 18:09         ` Anitha Boyapati
2011-02-15 18:48           ` Richard Henderson
2011-02-15 19:15             ` Anitha Boyapati
2011-02-15 19:03         ` [avr] gas support for cfi info Richard Henderson
2011-02-15 22:45           ` Petr Hluzín
2011-02-16 17:59             ` Richard Henderson
2011-02-16 22:49               ` Petr Hluzín [this message]
2011-02-17 16:12                 ` Richard Henderson
2011-02-17 16:16                   ` Tristan Gingold
2011-02-17 15:35               ` Anitha Boyapati
2011-02-17 16:05                 ` Richard Henderson

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=AANLkTimf0+YtnhES6AZyY75zjYHu_Gkh_M+dJo4N7mUx@mail.gmail.com \
    --to=petr.hluzin@gmail.com \
    --cc=aesok@post.ru \
    --cc=anitha.boyapati@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=chertykov@gmail.com \
    --cc=eric.weddington@atmel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb@sourceware.org \
    --cc=rth@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).