From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108511 invoked by alias); 4 Mar 2016 10:44:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 106193 invoked by uid 89); 4 Mar 2016 10:44:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Deliver, Hx-languages-length:1885, HERE X-HELO: mail-pa0-f65.google.com Received: from mail-pa0-f65.google.com (HELO mail-pa0-f65.google.com) (209.85.220.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 04 Mar 2016 10:44:43 +0000 Received: by mail-pa0-f65.google.com with SMTP id a7so2851372pax.3 for ; Fri, 04 Mar 2016 02:44:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=y1xq5ALVHulxurHuHW2D6g4UWciF4s1WKsnwBINkUYg=; b=jbXYPKkUQSzEcEcsnh1Cqj22lAKc0+9XaQrdPdOmGTTWwDv3I9wlF8IR7+By3wIXVc VD3Tv9DJm0Ns8zjRrFwY0YV2rneXPRU1KZDdrgTyLp2POK+Aua5uT/f/4WlIWV7EFPFS 0lyEbKx9gMRqfqABj1CpyugFAGlOQz7Ucx/sqJN+411TCeFbF2VaWjibtEUMQ9EvkM9I 9Cfzjuby1CJVMeiSk1pqNnmMMGWnk70LLf30FP8nE9PHf/svM1w64LXgK8yt+7a+mvdI AB92XzX1fFL6wjEWdoTlbQuTiow2lHFNeWPnDzvFNjHet6sb8rStkhb8THnYfGk9eKfv x4xA== X-Gm-Message-State: AD7BkJKloAVvx4h2k3+zkFH3WqwngSEnZttufUCEoJBGO5wmgZyY/LZHviLL5+03ielRpQ== X-Received: by 10.66.155.232 with SMTP id vz8mr10892522pab.53.1457088281961; Fri, 04 Mar 2016 02:44:41 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id e20sm4604321pfd.4.2016.03.04.02.44.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Mar 2016 02:44:41 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 0/8] Step over instruction branches to itself Date: Fri, 04 Mar 2016 10:44:00 -0000 Message-Id: <1457088276-1170-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00067.txt.bz2 When I test arm linux range stepping patches, fails in gdb.base/gdb-sigterm.exp lead me taking a look. I find gcc is quite smart to genreate *single* branch instruction for such endless for loop, for (;;); /* loop-line */ the instruction branches to itself. 0x00008638 <+28>: b 0x8638 However, current GDB and GDBserver doesn't handle this kind of instruction very well when stepping over breakpoint on top of it. This patch series fixes the problems when stepping over "branch to self" instruction, and it paves the way for arm linux range stepping patches and tracepoint patches. Patch 1 and 2 are refactor patch. Patch 4 is a GDB patch, and the rest of them are GDBserver patches. Test case is in the last patch. Patch 3 and patch 7 are about signal delivery when stepping over, I am not very sure about them, so these two can be treated as RFC. Regression tested on x86_64-linux and arm-linux. *** BLURB HERE *** Yao Qi (8): Set signal to 0 after enqueue_pending_signal Check LWP_SIGNAL_CAN_BE_DELIVERED for enqueue/dequeue pending signals Deliver signal in hardware single step Force to insert software single step breakpoint Insert breakpoint even when the raw breakpoint is found [GDBserver] Don't error in reinsert_raw_breakpoint if bp->inserted Resume the inferior with signal rather than stepping over New test case gdb.base/branch-to-self.exp gdb/breakpoint.c | 5 ++- gdb/gdbserver/linux-low.c | 66 +++++++++++++++++------------- gdb/gdbserver/mem-break.c | 19 ++++++++- gdb/testsuite/gdb.base/branch-to-self.c | 44 ++++++++++++++++++++ gdb/testsuite/gdb.base/branch-to-self.exp | 67 +++++++++++++++++++++++++++++++ 5 files changed, 171 insertions(+), 30 deletions(-) create mode 100644 gdb/testsuite/gdb.base/branch-to-self.c create mode 100644 gdb/testsuite/gdb.base/branch-to-self.exp -- 1.9.1