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: 49860 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4EC37211FD for ; Mon, 15 Jun 2015 12:22:53 +0000 (UTC) Received: by laka10 with SMTP id a10sf3972500lak.2 for ; Mon, 15 Jun 2015 05:22:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=c5jPlsUjYwErRriwqluiRqu4gRAeBoH8HgnRsqT6FLA=; b=bmXEzl4qbsMIHA6KBh6c21yOgam/yYwsai606zlbpeUaAYsxAWrU2f9OVPccJODJw3 aJQk6YKlqxLzUnZzlZ78g857c7Tah2188w+2mwAn071RirIWCKNUpdIXrFm75q7VLC7m /Ua+pMYSLioKrH/ovr20JqC7TT69jQuTELNjuqTS/NZScvN3tb1sgSOO8hFmR2P41bPG lg/MmQDzTKYDvPkxVOqullVQHPRF+8Btrpj90/pPf4RfJHDBV8AYNXV0XAJomfNGIo7n bc3HXmLiGgRiLCN716K+sBLzr10isn127zQCOJG3QiGJTuZRJ3zyrGIOFSCROwefdRH2 5t5A== X-Gm-Message-State: ALoCoQnPmAyVu65KnRmFzVMukIF54lwRQ5Qn0oDjWkUYv+cpnPiI/EQBmq3HkQZ6TpN2cP4oOFTs X-Received: by 10.194.175.36 with SMTP id bx4mr29592816wjc.1.1434370971940; Mon, 15 Jun 2015 05:22:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.41 with SMTP id bd9ls886917lab.109.gmail; Mon, 15 Jun 2015 05:22:51 -0700 (PDT) X-Received: by 10.112.29.209 with SMTP id m17mr5620254lbh.23.1434370971773; Mon, 15 Jun 2015 05:22:51 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id ay17si10383302lab.9.2015.06.15.05.22.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 05:22:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by lacny3 with SMTP id ny3so36651140lac.3 for ; Mon, 15 Jun 2015 05:22:51 -0700 (PDT) X-Received: by 10.112.41.196 with SMTP id h4mr14617lbl.36.1434370971660; Mon, 15 Jun 2015 05:22:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1378408lbb; Mon, 15 Jun 2015 05:22:50 -0700 (PDT) X-Received: by 10.140.105.69 with SMTP id b63mr6890381qgf.66.1434370970472; Mon, 15 Jun 2015 05:22:50 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o90si12522094qga.43.2015.06.15.05.22.49 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Jun 2015 05:22:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:33891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4TPd-0001zr-Lm for patch@linaro.org; Mon, 15 Jun 2015 08:22:49 -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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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); }