Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Florent DEFAY <spira.inhabitant@gmail.com>
Cc: jeremy.bennett@embecosm.com,
	Anthony Berent <Anthony.Berent@arm.com>,
		gdb@sourceware.org
Subject: Re: new port
Date: Wed, 20 May 2009 14:12:00 -0000	[thread overview]
Message-ID: <20090520141243.GE17566@adacore.com> (raw)
In-Reply-To: <8502af3c0905200126v68b6d474g9ee399bc163e8b5@mail.gmail.com>


> I think of a solution for (2):
> As I know PC, I can compute how many saved regs pushes
> have been already done. Then,
> or1k_unwind_sp (gdbarch, next_frame) + NUM_PUSHES * REG_SIZE
> gives me the SP when entering the function (falling stack).

That should correct, provided that your description of the frame
is correct. There's a somewhat similar situation with i386-tdep.c:
Normally, the frame pointer holds the frame address, but sometimes
functions are "frameless", and so we compute the frame base using
the stack pointer (your this_sp) and the frame size.  What's also
interesting with x86 is that, even when the frame uses a frame
pointer, the frame base address is actually an offset from what
that register contains (I think the offset is +8.  What I'm trying
to say is that, in the x86 case, the frame base is never the
content of a register, and that's not a necessity.

> (1) So I cannot find the base:
> trad_frame_set_this_base (info, this_sp);
> is not correct (the base is the final value, this_sp is not the final value).

This is related to your question above: You need to provide the value
of the frame base, which apparently is the value of the SP at the time
the function was entered.  It doesn't need to be the value of any given
register.

-- 
Joel


  reply	other threads:[~2009-05-20 14:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-14 13:24 Florent DEFAY
2009-05-14 13:50 ` Hui Zhu
2009-05-14 14:05 ` Anthony Berent
2009-05-14 14:37   ` Jeremy Bennett
2009-05-20  8:26     ` Florent DEFAY
2009-05-20 14:12       ` Joel Brobecker [this message]
2009-05-22 12:24         ` Florent DEFAY
2009-05-22 14:43           ` Joel Brobecker
2009-05-25  7:17             ` Florent DEFAY
2009-05-25 14:59               ` Florent DEFAY
     [not found] ` <130942881126505163@unknownmsgid>
2009-05-14 14:46   ` Florent DEFAY
2009-05-14 16:46     ` Hui Zhu

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=20090520141243.GE17566@adacore.com \
    --to=brobecker@adacore.com \
    --cc=Anthony.Berent@arm.com \
    --cc=gdb@sourceware.org \
    --cc=jeremy.bennett@embecosm.com \
    --cc=spira.inhabitant@gmail.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