From: Andrew Cagney <cagney@gnu.org>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA/RFC] Replace call_ptrace and ptrace_wait in inf-ptrace.c
Date: Fri, 24 Sep 2004 22:46:00 -0000 [thread overview]
Message-ID: <4154A313.6050601@gnu.org> (raw)
In-Reply-To: <200409242237.i8OMbNSY001761@elgar.sibelius.xs4all.nl>
> Either way we'll end up with casts:
> CORE_ADDR -> (void *)
> (void *) -> long
> etc, why not have methods that at least avoid the casts (or do it
> locally to GDB's ptrace code?).
>
> The problem here is that the third argument of ptrace is used for two
> purposes:
> 1. For specifying memory addresses of objects in the debugger's
> address space (PT_GETREGS, PT_SETREGS, PT_IO).
>
> 2. For specifying memory addresses in the inferior.
>
> This gets especially complicated with 32x64 "native" cross-debugging
> and is further complicated by the fact that some systems use an
> integer type and other systems use a pointer type for this third
> arguments.
Right, no matter what a single function is, casing is required.
> I've tried to come up with a function signature for
> gdb_ptrace() that would work for all targets, and I failed.
With two ptrace functions, one with void* (for host buffer) and one with
CORE_ADDR (for target address), this problem would be solved.
Andrew
prev parent reply other threads:[~2004-09-24 22:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-20 19:14 Mark Kettenis
2004-09-20 19:37 ` Andrew Cagney
2004-09-20 19:42 ` Daniel Jacobowitz
2004-09-20 21:48 ` Mark Kettenis
2004-09-21 13:09 ` Andrew Cagney
2004-09-24 22:37 ` Mark Kettenis
2004-09-24 22:46 ` Andrew Cagney [this message]
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=4154A313.6050601@gnu.org \
--to=cagney@gnu.org \
--cc=gdb-patches@sources.redhat.com \
--cc=mark.kettenis@xs4all.nl \
/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