This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdbserver ptrace() argument type cleanups.
- From: Tom Tromey <tromey at redhat dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: marcus dot shawcroft at arm dot com, gdb-patches at sourceware dot org, palves at redhat dot com
- Date: Mon, 04 Feb 2013 12:01:30 -0700
- Subject: Re: [PATCH] gdbserver ptrace() argument type cleanups.
- References: <510FF048.8070701@arm.com> <201302041857.r14IvSWJ000937@glazunov.sibelius.xs4all.nl>
>>>>> "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