]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user: fix the breakpoint inheritance in spawned threads
authorThierry Bultel <thierry.bultel@basystemes.fr>
Fri, 12 Jun 2015 09:24:10 +0000 (11:24 +0200)
committerRiku Voipio <riku.voipio@linaro.org>
Tue, 16 Jun 2015 05:21:02 +0000 (08:21 +0300)
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.

Signed-off-by: Thierry Bultel <thierry.bultel@basystemes.fr>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/main.c

index a0d3e58bd474c7a468e0c9443a7ce35b32608ebf..c855bccadcdb0deeb8432f0be87315e4b624dec8 100644 (file)
@@ -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);
     }