]> granicus.if.org Git - strace/commitdiff
POWERPC: if GETREGS fails with EIO, don't try it again
authorDenys Vlasenko <dvlasenk@redhat.com>
Fri, 28 Jun 2013 12:41:30 +0000 (14:41 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Fri, 28 Jun 2013 12:41:30 +0000 (14:41 +0200)
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
syscall.c

index fc7cd06db36f0c4033a12c635d24e2d85b6906d1..a44ac0c49404dc128ef376afe3d3a581047d66f5 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -1070,9 +1070,15 @@ get_regs(pid_t pid)
 # elif defined(SPARC) || defined(SPARC64)
        get_regs_error = ptrace(PTRACE_GETREGS, pid, (char *)&sparc_regs, 0);
 # elif defined(POWERPC)
+       static bool old_kernel = 0;
+       if (old_kernel)
+               goto old;
        get_regs_error = ptrace(PTRACE_GETREGS, pid, NULL, (long) &ppc_regs);
-       if (get_regs_error && errno == EIO)
+       if (get_regs_error && errno == EIO) {
+               old_kernel = 1;
+ old:
                get_regs_error = powerpc_getregs_old(pid);
+       }
 
 /* try PTRACE_GETREGSET first, fallback to PTRACE_GETREGS */
 # else