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

Hi,

Jeremy,

I try to rewrite my target-tdep.c from the beginning taking
or1k-tdep.c as a template.

In the function or1k_frame_unwind_cache,
you get SP that way:
this_sp = or1k_unwind_sp (gdbarch, next_frame);

But this function could be called at any step of the prologue.
As SP is added the frame size at the beginning of the prologue,
I think this_sp is always the good value (the base). But in my case,
the prologue begins by pushing saved registers and then
SP changes at every step. So if I get SP by doing
this_sp = or1k_unwind_sp (gdbarch, next_frame);
I get the SP value at this step of the execution, not the final value.

(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).

(2) Plus, I need the SP when entering the called function because
this is where PREVIOUS PC is saved.

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).

Do you think this solution is ok?

Have you an idea for the issue (1) ?

Thank you.

Regards.

Florent


  reply	other threads:[~2009-05-20  8:26 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 [this message]
2009-05-20 14:12       ` Joel Brobecker
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=8502af3c0905200126v68b6d474g9ee399bc163e8b5@mail.gmail.com \
    --to=spira.inhabitant@gmail.com \
    --cc=Anthony.Berent@arm.com \
    --cc=gdb@sourceware.org \
    --cc=jeremy.bennett@embecosm.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