From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4TNx-00085i-O8 for qemu-devel@nongnu.org; Mon, 15 Jun 2015 08:21:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4TNr-0003D0-PA for qemu-devel@nongnu.org; Mon, 15 Jun 2015 08:21:05 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:33402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4TNr-0003BP-2B for qemu-devel@nongnu.org; Mon, 15 Jun 2015 08:20:59 -0400 Received: by lblr1 with SMTP id r1so25785952lbl.0 for ; Mon, 15 Jun 2015 05:20:58 -0700 (PDT) From: riku.voipio@linaro.org Date: Mon, 15 Jun 2015 15:20:50 +0300 Message-Id: In-Reply-To: References: Subject: [Qemu-devel] [PULL 6/6] linux-user: fix the breakpoint inheritance in spawned threads List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Thierry Bultel From: Thierry Bultel 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 Signed-off-by: Riku Voipio --- linux-user/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index a0d3e58..c855bcc 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -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); } -- 2.1.4