Check out the latest LTP souce code and comiple it on ppc machine.
---------
cc -I../../../../include -Wall ptrace06.c -L../../../../lib -lltp -o
ptrace06
In file included from ptrace06.c:23:
spawn_ptrace_child.c:69: error: ‘PTRACE_GETREGS’ undeclared here (not in a
function)
spawn_ptrace_child.c:69: error: array index in initializer not of integer type
spawn_ptrace_child.c:69: error: (near initialization for ‘strings’)
spawn_ptrace_child.c:70: error: ‘PTRACE_SETREGS’ undeclared here (not in a
function)
spawn_ptrace_child.c:70: error: array index in initializer not of integer type
spawn_ptrace_child.c:70: error: (near initialization for ‘strings’)
make: *** [ptrace06] Error 1
# uname -a
Linux p51Aa 2.6.18-8.10AX #1 SMP Tue Aug 14 05:11:30 EDT 2007 ppc64
ppc64 ppc64 GNU/Linux
-------------
On ppc/ppc64, PTRACE_GETREGS and PTRACE_SETREGS don't be defined in
/usr/include/sys/ptrace.h. So add checks before use them.
Signed-off-by: Jin Bing Guo <[EMAIL PROTECTED]>
----------
Best regards!
Jin Bing Guo
--- cvs_ltp.orig/testcases/kernel/syscalls/ptrace/ptrace06.c 2008-09-26 19:01:20.000000000 -0400
+++ cvs_ltp/testcases/kernel/syscalls/ptrace/ptrace06.c 2008-10-06 03:53:35.000000000 -0400
@@ -78,6 +78,7 @@ struct test_case_t {
{ PTRACE_POKEUSER, .addr = -2 },
{ PTRACE_POKEUSER, .addr = -3 },
+#ifdef PTRACE_GETREGS
{ PTRACE_GETREGS, .data = 0 },
{ PTRACE_GETREGS, .data = 1 },
{ PTRACE_GETREGS, .data = 2 },
@@ -85,6 +86,7 @@ struct test_case_t {
{ PTRACE_GETREGS, .data = -1 },
{ PTRACE_GETREGS, .data = -2 },
{ PTRACE_GETREGS, .data = -3 },
+#endif
#ifdef PTRACE_GETFGREGS
{ PTRACE_GETFGREGS, .data = 0 },
@@ -96,6 +98,7 @@ struct test_case_t {
{ PTRACE_GETFGREGS, .data = -3 },
#endif
+#ifdef PTRACE_SETREGS
{ PTRACE_SETREGS, .data = 0 },
{ PTRACE_SETREGS, .data = 1 },
{ PTRACE_SETREGS, .data = 2 },
@@ -103,6 +106,7 @@ struct test_case_t {
{ PTRACE_SETREGS, .data = -1 },
{ PTRACE_SETREGS, .data = -2 },
{ PTRACE_SETREGS, .data = -3 },
+#endif
#ifdef PTRACE_SETFGREGS
{ PTRACE_SETFGREGS, .data = 0 },
--- cvs_ltp.orig/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.c 2008-10-05 23:11:51.000000000 -0400
+++ cvs_ltp/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.c 2008-10-06 03:52:43.000000000 -0400
@@ -66,8 +66,12 @@ static char *strings[] = {
SPT(POKETEXT)
SPT(POKEDATA)
SPT(POKEUSER)
+#ifdef PTRACE_GETREGS
SPT(GETREGS)
+#endif
+#ifdef PTRACE_SETREGS
SPT(SETREGS)
+#endif
SPT(GETSIGINFO)
SPT(SETSIGINFO)
#ifdef PTRACE_GETFGREGS
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list