This patch makes sufficient modifications to the SH sys/user.h to be able to build and run gdbserver with Linux kernel 2.6.30.

The problem is that both the kernel and library headers define the same symbols, thus making it impossible in include both headers. The patch undefines the kernel symbols in favour of the library symbols.

The patch has already been applied to glibc.

Please apply this patch if it is OK.

Thanks

Andrew

2009-09-14  Andrew Stubbs  <a...@codesourcery.com>

	* libc/sysdeps/linux/sh/sys/user.h (PTRACE_GETREGS, PTRACE_SETREGS,
	PTRACE_GETFPREGS, PTRACE_SETFPREGS, PTRACE_GETFDPIC,
	PTRACE_GETFDPIC_EXEC, PTRACE_GETFDPIC_INTERP, PTRACE_GETDSPREGS,
	PTRACE_SETDSPREGS): Undefine.

---
 .../libc/sysdeps/linux/sh/sys/user.h               |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

--- libc/sysdeps/linux/sh/sys/user.h
+++ libc/sysdeps/linux/sh/sys/user.h
@@ -22,6 +22,17 @@
 #include <unistd.h>
 #include <asm/ptrace.h>
 
+/* asm/ptrace.h polutes the namespace.  */
+#undef PTRACE_GETREGS
+#undef PTRACE_SETREGS
+#undef PTRACE_GETFPREGS
+#undef PTRACE_SETFPREGS
+#undef PTRACE_GETFDPIC
+#undef PTRACE_GETFDPIC_EXEC
+#undef PTRACE_GETFDPIC_INTERP
+#undef PTRACE_GETDSPREGS
+#undef PTRACE_SETDSPREGS
+
 /*
  * Core file format: The core file is written in such a way that gdb
  * can understand it and provide useful information to the user (under

_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to