Skip to contentSkip to conversation

linux-user: fix the breakpoint inheritance in spawned threads

PATCH New Thierry Bultel 1 participant 1 message Jun 12, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: fix the breakpoint inheritance in spawned threads

When a thread is spawned, cpu_copy re-initializes the bp & wp lists of current thread, instead of the ones of the new thread.
The effect is that breakpoints are no longer hit.

---
 linux-user/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
linux-user/main.c +2 -2
index 6989b82..309562a 100644
@@ -3459,8 +3459,8 @@ CPUArchState *cpu_copy(CPUArchState *env)
     /* Clone all break/watchpoints.
        Note: Once we support ptrace with hw-debug register access, make sure
        BP_CPU break/watchpoints are handled correctly on clone. */
-    QTAILQ_INIT(&cpu->breakpoints);
-    QTAILQ_INIT(&cpu->watchpoints);
+    QTAILQ_INIT(&new_cpu->breakpoints);
+    QTAILQ_INIT(&new_cpu->watchpoints);
     QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
         cpu_breakpoint_insert(new_cpu, bp->pc, bp->flags, NULL);
     }
Signature · 1 line
1.9.1