From patchwork Mon Sep 26 05:01:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 16009 Received: (qmail 87763 invoked by alias); 26 Sep 2016 05:01:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk 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 87729 invoked by uid 89); 26 Sep 2016 05:01:28 -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=HX-Received:10.98.0.69 X-HELO: mail-pf0-f196.google.com Received: from mail-pf0-f196.google.com (HELO mail-pf0-f196.google.com) (209.85.192.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Sep 2016 05:01:18 +0000 Received: by mail-pf0-f196.google.com with SMTP id 6so8552180pfl.2 for ; Sun, 25 Sep 2016 22:01:18 -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:subject:date:message-id; bh=qFQH1CcwwNv1HPL+/UVXCypufvWfC10sjayk6iYxT04=; b=dA/jrthF7HwQbevVriItIOQgnuGv2njxU9IeWv6EvTazaPdloJGX1r5Q8pbco2P3id f6xKZv/OiScHoGZKg5eqZgJBlvXUmMqf5w1t4leZ+UvqWyot04KVERcIAXlUgtyXULMe +Y2nyM/QF65N7VHo1497Ph4U0GzUC9Efytes6jgBvIc8CKnMc/gha2e66y2Qxn1j9xVE ym0jYFgHkgGF9vQgLd1dyGKmF1nJvs84Eo5atQhfx9stso7FWvky2+VKhYz1w3NpYEpD xN9Ao+xj1H8GGPrevVRRguxQFa0YFH/YpfrRjJC8mYmk9nwToBQRbSQ3Mo2jM/rg8uXi 3c3g== X-Gm-Message-State: AE9vXwPzrI8GLcSycgK1w6iEvLAOEJbyiHF/P0hOsosZf/mPA8dCfGNH1NEjtH+vVVyqYA== X-Received: by 10.98.0.69 with SMTP id 66mr34724641pfa.140.1474866076852; Sun, 25 Sep 2016 22:01:16 -0700 (PDT) Received: from localhost.localdomain (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id r66sm26919582pfb.54.2016.09.25.22.01.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 Sep 2016 22:01:16 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Don't set random_signal for single step breakpoint Date: Mon, 26 Sep 2016 06:01:14 +0100 Message-Id: <1474866074-21720-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes I happen to see the code, and find the comments are out of date, because single-step breakpoint is not transparent to the breakpoint module. If one thread hits another thread's single-step breakpoint, random_signal should be zero. IOW, if random_signal is one, the thread shouldn't hit any single-step breakpoints. This patch is to remove this piece of code. gdb: 2016-09-26 Yao Qi * infrun.c (handle_signal_stop): Don't set random_signal by ecs->hit_singlestep_breakpoint. --- gdb/infrun.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 648e2b6..b133f04 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -6056,12 +6056,6 @@ handle_signal_stop (struct execution_control_state *ecs) random_signal = !(ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP && currently_stepping (ecs->event_thread)); - /* Perhaps the thread hit a single-step breakpoint of _another_ - thread. Single-step breakpoints are transparent to the - breakpoints module. */ - if (random_signal) - random_signal = !ecs->hit_singlestep_breakpoint; - /* No? Perhaps we got a moribund watchpoint. */ if (random_signal) random_signal = !stopped_by_watchpoint;