From patchwork Tue Jun 16 07:06:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 484808 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 705831401F6 for ; Tue, 16 Jun 2015 17:09:41 +1000 (AEST) Received: from localhost ([::1]:38180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4l07-0000kD-97 for incoming@patchwork.ozlabs.org; Tue, 16 Jun 2015 03:09:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4kxG-0004EN-PD for qemu-devel@nongnu.org; Tue, 16 Jun 2015 03:06:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4kxD-0006oP-Jj for qemu-devel@nongnu.org; Tue, 16 Jun 2015 03:06:42 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:33243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4kxD-0006o2-DZ for qemu-devel@nongnu.org; Tue, 16 Jun 2015 03:06:39 -0400 Received: by lblr1 with SMTP id r1so4733242lbl.0 for ; Tue, 16 Jun 2015 00:06:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c5jPlsUjYwErRriwqluiRqu4gRAeBoH8HgnRsqT6FLA=; b=h9G7GsScX9q0sXUNAzhImMFPX5V4oX/hKoIqgPWZ8IdOndYmhI2owMXac9+L0EIG6d mdePlDWblBzap2RhMNzUPuQ+Ta07sKM7BU9Ghs+yvLkjYv/mztfZsKE2H8/1lbKyAWWy TBueQiOLoGhVRcHP6V7F/kNJ1zG+jASmm07n69RQ0rgqIbO4GblUiMHmuQiFCxcRofcf JcnguZyBth7UuZc0X3RBgyMjS/ejt4FVZpBb/Kk55Xec5XMsBQ7bImo17ijEgNQSRC5Y 5Fj98Fk8j/V3DHs+A/1f0ej9NvwZwIxxCDpAw3q1ep5NKEFv1M5F7SNwraDCvt54MY/D SnwA== X-Gm-Message-State: ALoCoQnAdL2RGrZ1YQ05M/78Z3FJPZcPtpTieVgtVq8nKrUc/KcGqmqPdub7ZzMs++hIuwrRVZ8T X-Received: by 10.152.43.69 with SMTP id u5mr30955920lal.119.1434438398878; Tue, 16 Jun 2015 00:06:38 -0700 (PDT) Received: from localhost.localdomain (91-157-196-38.elisa-laajakaista.fi. [91.157.196.38]) by mx.google.com with ESMTPSA id wc8sm27104lbb.37.2015.06.16.00.06.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Jun 2015 00:06:38 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 16 Jun 2015 10:06:31 +0300 Message-Id: <1d085f6cae51b1a0fb92ad03ce8bf038e29c9750.1434438233.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.217.182 Cc: peter.maydell@linaro.org, Thierry Bultel Subject: [Qemu-devel] [PULL v2 5/6] linux-user: fix the breakpoint inheritance in spawned threads X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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); }