Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: marcus.shawcroft@arm.com, gdb-patches@sourceware.org, palves@redhat.com
Subject: Re: [PATCH] gdbserver ptrace() argument type cleanups.
Date: Mon, 04 Feb 2013 19:01:00 -0000	[thread overview]
Message-ID: <876227299x.fsf@fleche.redhat.com> (raw)
In-Reply-To: <201302041857.r14IvSWJ000937@glazunov.sibelius.xs4all.nl> (Mark	Kettenis's message of "Mon, 4 Feb 2013 19:57:28 +0100 (CET)")

>>>>> "Mark" == Mark Kettenis <mark.kettenis@xs4all.nl> writes:

Mark> I'd use the word "obfuscation" instead of "cleanup".

It is awful but necessary.
I think calls in gdb proper probably need this as well.


I did try writing a patch to fix it a different way, without as many
casts:

+static inline PTRACE_TYPE_RET
+gdb_ptrace (int request, pid_t pid, PTRACE_TYPE_ARG3 addr, void *data)
+{
+  return ptrace (request, pid, addr, data);
+}
+
+#undef ptrace
+#define ptrace ERROR


... followed by using gdb_ptrace everywhere.

However you do still need casts at some call points.
It's quite awful.

I can send this if anyone thinks it is better.

Tom


  reply	other threads:[~2013-02-04 19:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-04 17:31 Marcus Shawcroft
2013-02-04 17:35 ` Pedro Alves
2013-02-04 17:41   ` Marcus Shawcroft
2013-02-04 18:57 ` Mark Kettenis
2013-02-04 19:01   ` Tom Tromey [this message]
2013-02-04 19:25     ` Pedro Alves
2013-02-04 22:09     ` Mark Kettenis
2013-02-04 19:04   ` Marcus Shawcroft

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=876227299x.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=marcus.shawcroft@arm.com \
    --cc=mark.kettenis@xs4all.nl \
    --cc=palves@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