From patchwork Tue Apr 7 15:52:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 46837 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 28515214BA for ; Tue, 7 Apr 2015 15:52:40 +0000 (UTC) Received: by lbcne10 with SMTP id ne10sf13878135lbc.1 for ; Tue, 07 Apr 2015 08:52: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:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results; bh=HlBb+l9cBElxgHFm/B1yWamIw0A7gmPy+aipSqhxyFs=; b=kjHTgRNiszbEncwAC77CO4UOyEJZulmrs1IdAJOie6Ol4RAr2eLenedBm6nsHStVIB szcPdjqg+q3avxkB4+cCeYwxQdKb76a+QLAltb+DNSXU+izOGZLuJtn0dJQdF0Hylm21 3DHEu2MVHTlFdHxsCCGx6U61zmBBf6NbHQQpkmcgA07K3FwAFOJ/aI3LfNLcNfATnXpC M5LPyIjoh+LYA6XSPoSylKE4kFJ7k2mgIQ28Us0k73Hf46aZ8hCzboq4OfaK2NY7dXyo NmITNVa8xVsJpWnc16r3iLxghSU6vrLCIGTyW45X4TMKSnueEGeG/Iz/Lo0OI4bMPIL5 s8aw== X-Gm-Message-State: ALoCoQn1ysWrhXpUdvPNzLpkegS1bR/8JEe6/lmN8/dc24taKeWBfhdRddIR7dXXOsUKUDElI5Y+ X-Received: by 10.180.89.36 with SMTP id bl4mr603882wib.2.1428421958921; Tue, 07 Apr 2015 08:52:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.199 with SMTP id x7ls72090lae.0.gmail; Tue, 07 Apr 2015 08:52:38 -0700 (PDT) X-Received: by 10.152.6.71 with SMTP id y7mr18724998lay.116.1428421958637; Tue, 07 Apr 2015 08:52:38 -0700 (PDT) Received: from mail-lb0-x235.google.com (mail-lb0-x235.google.com. [2a00:1450:4010:c04::235]) by mx.google.com with ESMTPS id t4si4945316lbk.135.2015.04.07.08.52.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2015 08:52:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::235 as permitted sender) client-ip=2a00:1450:4010:c04::235; Received: by lboc7 with SMTP id c7so45973739lbo.1 for ; Tue, 07 Apr 2015 08:52:38 -0700 (PDT) X-Received: by 10.152.234.169 with SMTP id uf9mr18972840lac.88.1428421958529; Tue, 07 Apr 2015 08:52:38 -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.67.65 with SMTP id l1csp509102lbt; Tue, 7 Apr 2015 08:52:37 -0700 (PDT) X-Received: by 10.68.222.231 with SMTP id qp7mr37316583pbc.7.1428421956688; Tue, 07 Apr 2015 08:52:36 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id sa3si12030889pac.27.2015.04.07.08.52.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2015 08:52:36 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-return-121644-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 92762 invoked by alias); 7 Apr 2015 15:52:15 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Subscribe: List-Archive: List-Post: , List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 92703 invoked by uid 89); 7 Apr 2015 15:52:15 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f172.google.com Received: from mail-pd0-f172.google.com (HELO mail-pd0-f172.google.com) (209.85.192.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 07 Apr 2015 15:52:12 +0000 Received: by pdbnk13 with SMTP id nk13so83116137pdb.0 for ; Tue, 07 Apr 2015 08:52:10 -0700 (PDT) X-Received: by 10.66.235.36 with SMTP id uj4mr37601902pac.123.1428421930623; Tue, 07 Apr 2015 08:52:10 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id u8sm6893859pdj.46.2015.04.07.08.52.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Apr 2015 08:52:10 -0700 (PDT) From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 1/2] [gdbserver] assert on step if !can_hardware_single_step Date: Tue, 7 Apr 2015 16:52:04 +0100 Message-Id: <1428421925-18025-2-git-send-email-qiyaoltc@gmail.com> In-Reply-To: <1428421925-18025-1-git-send-email-qiyaoltc@gmail.com> References: <1428421925-18025-1-git-send-email-qiyaoltc@gmail.com> X-IsSubscribed: yes X-Original-Sender: qiyaoltc@gmail.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::235 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com X-Google-Group-Id: 836684582541 From: Yao Qi GDB sends vCont;s by mistake to GDBserver on arm target which doesn't have single step at all. However, it is hard to find the problem from the debugging log. With this patch applied, the problem is easy to identify, like: (gdb) PASS: gdb.threads/non-stop-fair-events.exp: signal_thread=2: switch to thread 6 to step it step&^M (gdb) PASS: gdb.threads/non-stop-fair-events.exp: signal_thread=2: set 6 thread stepping thread /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:3686: A problem internal to GDBserver has been detected.^M linux_resume_one_lwp_throw: Assertion `step == 0' failed. gdb/gdbserver: 2015-04-02 Yao Qi * linux-low.c (linux_resume_one_lwp_throw): Assert on step. --- gdb/gdbserver/linux-low.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index e4c5420..bc6ab1ae 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -3682,6 +3682,9 @@ linux_resume_one_lwp_throw (struct lwp_info *lwp, if (the_low_target.prepare_to_resume != NULL) the_low_target.prepare_to_resume (lwp); + if (!can_hardware_single_step ()) + gdb_assert (step == 0); + regcache_invalidate_thread (thread); errno = 0; lwp->stepping = step;