This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdbserver ptrace() argument type cleanups.


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]