summaryrefslogtreecommitdiff
path: root/syscall.c
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2013-06-28 14:41:30 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2013-06-28 14:41:30 +0200
commit7eb893236ca547779b597325a4a0e4b349e4c566 (patch)
treebf55184a9fa9f10b6b8d9a19b3d4bdd9a9e76102 /syscall.c
parent7f5a132c817ee70343913619371adc29691832bc (diff)
downloadstrace-7eb893236ca547779b597325a4a0e4b349e4c566.tar.gz
strace-7eb893236ca547779b597325a4a0e4b349e4c566.tar.bz2
strace-7eb893236ca547779b597325a4a0e4b349e4c566.tar.xz
POWERPC: if GETREGS fails with EIO, don't try it again
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'syscall.c')
-rw-r--r--syscall.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/syscall.c b/syscall.c
index fc7cd06..a44ac0c 100644
--- 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