Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sources.redhat.com
Subject: Question regarding storing/restoring data during inferior function call
Date: Tue, 18 Oct 2005 18:46:00 -0000	[thread overview]
Message-ID: <20051018184607.GO1034@adacore.com> (raw)

Hello,

I'm working on inferior function calls on ia64-hpux (which I'd like to
eventually contribute), and I've hit a glitch: HPUX does not allow us
to modify the BSP register. So this prevents us from creating a new
RSE frame for the function being called.

One way around this problem that I thought about was to keep the BSP
as is. This meant adjusting a bit the addresses where the arguments
were saved. But more importantly, this meant that we overwrote the
output section of the register frame.

It's pretty easy to add some code in GDB to save this data, either
on the inferior stack frame or perhaps directly in debugger memory.
However, I don't see a clear way for us to do the restoration. Is
there any?

Right now, the inferior function call is made AT_ENTRY_POINT. One
way to solve my problem that might work is to make the call ON_STACK.
Not sure if that's allowed on this chip.  But this way, I can
dynamically create a small piece of code that does the branch to the
target function, which would implicitly cause the BSP update that
we're currently doing ourselves. This does open a whole can of worms,
though, as I think I'll need to revisit the entire dummy frame unwinder,
won't I?

Any suggestion? The simplest for me would probably to add an extra
mechanism to do associate a restore procedure to the popping of the
dummy frame (or something like that), where I believe the registers
are restored.

Thanks,
-- 
Joel


             reply	other threads:[~2005-10-18 18:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-18 18:46 Joel Brobecker [this message]
2005-10-18 19:12 ` Daniel Jacobowitz
2005-10-18 20:00   ` Mark Kettenis

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=20051018184607.GO1034@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sources.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