Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>,
	marcus.shawcroft@arm.com,        gdb-patches@sourceware.org
Subject: Re: [PATCH] gdbserver ptrace() argument type cleanups.
Date: Mon, 04 Feb 2013 19:25:00 -0000	[thread overview]
Message-ID: <51100B0B.50603@redhat.com> (raw)
In-Reply-To: <876227299x.fsf@fleche.redhat.com>

On 02/04/2013 07:01 PM, Tom Tromey wrote:
>>>>>> "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.

Yeah, the same occurred to me.  I didn't try it, but I guessed
you'd need casts anyway, given some ptrace calls take
pointers as extra arguments, while others take integers.
In the end, I just tucked in under the "oh well, it's not that
important" rug.  :-)  However, Marcus' patch is only following
the status quo (*), so I didn't bring that up.  Without seeing the
result it's hard to say which is better.

(*) - http://sourceware.org/ml/gdb-patches/2012-03/msg01072.html

-- 
Pedro Alves


  reply	other threads:[~2013-02-04 19:25 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
2013-02-04 19:25     ` Pedro Alves [this message]
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=51100B0B.50603@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=marcus.shawcroft@arm.com \
    --cc=mark.kettenis@xs4all.nl \
    --cc=tromey@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