summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Mosberger <davidm@tiger.hpl.hp.com>2003-12-30 09:10:09 -0800
committerDavid Mosberger <davidm@tiger.hpl.hp.com>2003-12-30 09:10:09 -0800
commit45f4d49a7c915a397013cd4b3fcdbb65e62b1417 (patch)
tree328510b3688074530e0560185e3f6697d65c9c05 /include
parent3a450ae439727ef6a091345394448a80b0e78e50 (diff)
ia64: Fix a ptrace-bug that caused "strace -f" to crash the inferior
process. The root-cause of the problem was that ptrace() tried to copy the portion of the register backing store that landed on the kernel stack back to users-space, but the resulting state was inconsistent if the inferior process was in the middle of a system-call (as would always be the case for strace). The solution is to avoid all needless copying and to instead ensure that when accessing a memory location that may belong to a thread's register-backing store, we attach to that particular thread, rather than the thread identified by the PID argument. If the thread happens to be unattachable, we fall back to using the thread identified by the PID argument. This should have the desired effect if the thread has terminated already and if the thread is running while ptrace() is trying to access its state, all bets are off anyhow and there are no coherency guarantees. In other words, this should be doing the right thing under all circumstances. The patch also fixes the case where PT_AR_BSP and/or PT_CFM are written while the inferior process is in the middle of a system call. This makes arguments passed to GDB inferior calls come out right. The patch was tested with strace -f and the GDB testsuite, which showed no regressions compared to the previous version of the kernel.
Diffstat (limited to 'include')
-rw-r--r--include/asm-ia64/processor.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index 5948902ae28b..91ca5ec53c9c 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -64,7 +64,7 @@
#define IA64_THREAD_PM_VALID (__IA64_UL(1) << 2) /* performance registers valid? */
#define IA64_THREAD_UAC_NOPRINT (__IA64_UL(1) << 3) /* don't log unaligned accesses */
#define IA64_THREAD_UAC_SIGBUS (__IA64_UL(1) << 4) /* generate SIGBUS on unaligned acc. */
-#define IA64_THREAD_KRBS_SYNCED (__IA64_UL(1) << 5) /* krbs synced with process vm? */
+ /* bit 5 is currently unused */
#define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6) /* don't log any fpswa faults */
#define IA64_THREAD_FPEMU_SIGFPE (__IA64_UL(1) << 7) /* send a SIGFPE for fpswa faults */
#define IA64_THREAD_XSTACK (__IA64_UL(1) << 8) /* stack executable by default? */