From patchwork Mon Jun 15 12:20:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 484258 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 D735F140216 for ; Mon, 15 Jun 2015 22:22:39 +1000 (AEST) Received: from localhost ([::1]:33891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4TPS-0001zr-26 for incoming@patchwork.ozlabs.org; Mon, 15 Jun 2015 08:22:38 -0400 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) 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=DZYHKW2gGDHHMbuZbSIxJkwLzDJulgoxJY27NW/CzJ4xVmCkKmd7/UoqVCYF1K0nce 93nwp9HgmpLo0HG5n/IXC9xKz6WCjlhXtG3Rix6aOx3HXWuyCilgbT+rWF5PirGnJ/h1 hb1ISD7KY0CHBTjLXNxpZ3la1t//DlKljq7AomrytDXRTvrUHaYm+YM8gvYZYh9GvKir KYTxSjXGtGR30Hx9YcII2CsBSa6IxTlTYEtOA9jNLYJ3lxdO9sUYHjfkZWMyx/Ai7UnX FZB/xdHZ73OtAP93TWoFE+0iulw4NXqp3AnqtQw3IVMx0DvGiL2d9S8BoUPdXdjKh+pB R2Xw== X-Gm-Message-State: ALoCoQmFYza1OZFjdjQnO8PQvxp4wKVySt3OYbD+dH6rHPk7G9hf/7B4jnskLZd1ZF5Li1VY9Tv9 X-Received: by 10.152.37.196 with SMTP id a4mr27225729lak.59.1434370858439; Mon, 15 Jun 2015 05:20:58 -0700 (PDT) Received: from localhost.localdomain (91-157-196-38.elisa-laajakaista.fi. [91.157.196.38]) by mx.google.com with ESMTPSA id bm5sm2683890lbc.45.2015.06.15.05.20.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Jun 2015 05:20:57 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 15 Jun 2015 15:20:50 +0300 Message-Id: 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.177 Cc: peter.maydell@linaro.org, Thierry Bultel Subject: [Qemu-devel] [PULL 6/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); }