From patchwork Wed Oct 8 11:29:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 3134 Received: (qmail 1845 invoked by alias); 8 Oct 2014 11:34:07 -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 1835 invoked by uid 89); 8 Oct 2014 11:34:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Oct 2014 11:34:05 +0000 Received: from svr-orw-fem-04.mgc.mentorg.com ([147.34.97.41]) by relay1.mentorg.com with esmtp id 1XbpVK-0001x3-4F from Yao_Qi@mentor.com ; Wed, 08 Oct 2014 04:34:02 -0700 Received: from GreenOnly (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.3.181.6; Wed, 8 Oct 2014 04:34:01 -0700 From: Yao Qi To: Pedro Alves CC: Subject: Re: [PATCH 3/3] Fix non-stop regressions caused by "breakpoints always-inserted off" changes References: <1411657123-16228-1-git-send-email-palves@redhat.com> <1411657123-16228-4-git-send-email-palves@redhat.com> Date: Wed, 8 Oct 2014 19:29:52 +0800 In-Reply-To: <1411657123-16228-4-git-send-email-palves@redhat.com> (Pedro Alves's message of "Thu, 25 Sep 2014 15:58:43 +0100") Message-ID: <87fveyu7db.fsf@codesourcery.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes Pedro Alves writes: > - if (signal_print[ecs->event_thread->suspend.stop_signal]) > - { > - /* The signal table tells us to print about this signal. */ > - printed = 1; > - target_terminal_ours_for_output (); > - observer_notify_signal_received (ecs->event_thread->suspend.stop_signal); > - } > /* Always stop on signals if we're either just gaining control > of the program, or the user explicitly requested this thread > to remain stopped. */ > @@ -4214,10 +4207,17 @@ handle_signal_stop (struct execution_control_state *ecs) > stop_waiting (ecs); > return; > } > - /* If not going to stop, give terminal back > - if we took it away. */ > - else if (printed) The use of local variable 'printed' is removed by this patch. We can remove 'printed' too, as the patch below does. It is obvious, and I'll push it in. diff --git a/gdb/infrun.c b/gdb/infrun.c index 7b43785..4681175 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4425,7 +4425,6 @@ handle_signal_stop (struct execution_control_state *ecs) if (random_signal) { /* Signal not for debugging purposes. */ - int printed = 0; struct inferior *inf = find_inferior_pid (ptid_get_pid (ecs->ptid)); enum gdb_signal stop_signal = ecs->event_thread->suspend.stop_signal;