aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppc-linux-nat.c
diff options
context:
space:
mode:
authorLuis Machado <luisgpm@br.ibm.com>2013-05-07 07:43:33 +0000
committerLuis Machado <luisgpm@br.ibm.com>2013-05-07 07:43:33 +0000
commitaacbb8a556ab7e211763d285ae7b756329f902e2 (patch)
tree84f0eca4909ab065263fa8b9ba0ff2e23d98480d /gdb/ppc-linux-nat.c
parent0c013353548bec7e622e7ab6095f0e301171a3ff (diff)
downloadgdb-aacbb8a556ab7e211763d285ae7b756329f902e2.zip
gdb-aacbb8a556ab7e211763d285ae7b756329f902e2.tar.gz
gdb-aacbb8a556ab7e211763d285ae7b756329f902e2.tar.bz2
gdb/
* ppc-linux-nat.c (ppc_linux_new_thread): Clear the new thread's debug state prior to replicating existing hardware watchpoints or breakpoints. gdb/testsuite/ * gdb.threads/wp-replication.c: New file. * gdb.threads/wp-replication.exp: New file.
Diffstat (limited to 'gdb/ppc-linux-nat.c')
-rw-r--r--gdb/ppc-linux-nat.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index edb16c0..280dcbe 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -2178,7 +2178,18 @@ ppc_linux_new_thread (struct lwp_info *lp)
/* Copy that thread's breakpoints and watchpoints to the new thread. */
for (i = 0; i < max_slots_number; i++)
if (hw_breaks[i].hw_break)
- booke_insert_point (hw_breaks[i].hw_break, tid);
+ {
+ /* Older kernels did not make new threads inherit their parent
+ thread's debug state, so we always clear the slot and replicate
+ the debug state ourselves, ensuring compatibility with all
+ kernels. */
+
+ /* The ppc debug resource accounting is done through "slots".
+ Ask the kernel the deallocate this specific *point's slot. */
+ ptrace (PPC_PTRACE_DELHWDEBUG, tid, 0, hw_breaks[i].slot);
+
+ booke_insert_point (hw_breaks[i].hw_break, tid);
+ }
}
else
ptrace (PTRACE_SET_DEBUGREG, tid, 0, saved_dabr_value);