From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20749 invoked by alias); 16 Dec 2015 16:52:59 -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 20739 invoked by uid 89); 16 Dec 2015 16:52:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=0.998-1--Notify, 0.995-1--unpatched X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 16 Dec 2015 16:52:57 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 92B10347A56; Wed, 16 Dec 2015 16:52:56 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBGGqtcP012335; Wed, 16 Dec 2015 11:52:55 -0500 Message-ID: <567196E6.9040602@redhat.com> Date: Wed, 16 Dec 2015 16:52:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Tedeschi, Walfred" , "'Joel Brobecker'" CC: "'gdb-patches@sourceware.org'" Subject: Re: [PATCH v1] Intel(R) MPX - Bound violation handling. References: <1445864086-4831-1-git-send-email-walfred.tedeschi@intel.com> <1445864086-4831-4-git-send-email-walfred.tedeschi@intel.com> <20151119000134.GB7958@adacore.com> <566F0E37.8090905@redhat.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-12/txt/msg00306.txt.bz2 On 12/16/2015 03:19 PM, Tedeschi, Walfred wrote: > Pedro, > > We have found an interesting fact, changing the order the observer_notify_signal_recieved from about line 8170 to just before > Observer_notify_normal_stop. Allows the evaluation of the siginfo without the stop. That's because we're about to present a stop to the user, so we mark the threads as stopped in between: /* Let the user/frontend see the threads as stopped. */ do_cleanups (old_chain); But there's another observer_notify_signal_received call that is done while threads are still marked running. Here when we print the signal, but don't stop: /* Notify observers the signal has "handle print" set. Note we returned early above if stopping; normal_stop handles the printing in that case. */ if (signal_print[ecs->event_thread->suspend.stop_signal]) { /* The signal table tells us to print about this signal. */ target_terminal_ours_for_output (); observer_notify_signal_received (ecs->event_thread->suspend.stop_signal); target_terminal_inferior (); } Should gdb print the extra info in that case? In any case, for the normal_stop case, I think you'd want to move the observers call to just after the do_cleanups call shown above. At least, put it before the stop hook handling. If something sets the target running in the stop hook, then you'd lose stopped_by_random_signal. > Looking at the code I could not see anything could harm there. This may change output order, both CLI and MI. Please actually try using the resulting gdb to intercept a signal, and compare it with an unpatched gdb. Also, running the testsuite wouldn't be a bad idea... > > What do you think? Is moving that code a possibility? Thanks, Pedro Alves