Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [RFC] how to call host-side stuff from -tdep code?
Date: Tue, 21 Dec 2010 11:20:00 -0000	[thread overview]
Message-ID: <20101221111951.GE2596@adacore.com> (raw)

Hello,

I am about 75% through porting FSF HEAD to ia64-hpux, and I have
a question:

I'm inside ia64-tdep.c, and I need to determine whether we're inside
a system call or not.  Apparently, the way to do that is to perform
a call to ttrace (I'm planning on wrapping this inside a -nat.c file).
But of course, you are not supposed to do that, since the -nat module
is not available in the case of a cross debugger.

To be more precise, the ttrace request is a TT_LWP_RUREGS, using
an offset set to __reason.  If the returned value is zero, then
we're in a syscall.  Otherwise, we're not.  In a way, this could
be thought of as a special register.

I don't think that adding a raw register would be really be all
that appealing, since it'd be accessible to the user.

I thought about a pseudo register, but this seems awkward, if possible
at all.  My understanding is that pseudo-registers are really a thing
of the target, which cannot depend on native stuff.

It seems to me that the easiest solution right now is to add a new
xfer object (say TARGET_OBJECT_IA64/"ia64.in_syscall"), and then
use target_xfer_partial to get the information I needed. Is that
what these objects were meant for?

I considered adding a new target method, but that seems way overkill,
just for one platform.

Any other suggestion?

-- 
Joel


             reply	other threads:[~2010-12-21 11:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-21 11:20 Joel Brobecker [this message]
2010-12-21 12:39 ` 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=20101221111951.GE2596@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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