From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12711 invoked by alias); 19 Sep 2014 17:04:16 -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 12700 invoked by uid 89); 19 Sep 2014 17:04:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 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; Fri, 19 Sep 2014 17:04:14 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8JH4Ajc023534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 19 Sep 2014 13:04:11 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8JH49WV024895; Fri, 19 Sep 2014 13:04:09 -0400 Message-ID: <541C6208.3080805@redhat.com> Date: Fri, 19 Sep 2014 17:04:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Honour SIGILL and SIGSEGV in cancel breakpoint References: <1410696393-29327-1-git-send-email-yao@codesourcery.com> <54182945.7090300@redhat.com> <87mw9xzmlr.fsf@codesourcery.com> In-Reply-To: <87mw9xzmlr.fsf@codesourcery.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-09/txt/msg00635.txt.bz2 On 09/18/2014 03:30 AM, Yao Qi wrote: > Pedro Alves writes: > >> Instead of duplicating the code and comments, please factor out >> the SIGTRAP+SIGILL+SIGSEGVs checks to a helper function. On the GDB side, >> we have linux_nat_lp_status_is_event, and we see that it's also used >> on count_count_events_callback (which gdbserver also has), which makes >> sense, as it's counting threads that had breakpoint SIGTRAP-ish >> events (though I'm not sure why we only consider breakpoints when >> selecting the event lwp). > > I take a look at linux_nat_lp_status_is_event and email discussions on > adding this function , > a new function lp_status_is_sigtrap_like_event is added. I think something with "breakpoint" in the name, like lp_status_maybe_breakpoint would be even clearer. The event is SIGTRAP-like only in the sense that it may signal a breakpoint like SIGTRAP does. A SIGILL is not sigtrap-like for single-steps, for example. > I don't use > the same name because I feel linux_nat_lp_status_is_event isn't clear > enough. Secondly, I don't use "waitstatus.kind == TARGET_WAITKIND_IGNORE" > condition check inside lp_status_is_sigtrap_like_event, because IMO it > was used in linux_nat_lp_status_is_event due to lack of lp->status_p > flag, as the comments described. However, in GDBserver, we have > status_pending_p flag, so "waitstatus.kind == TARGET_WAITKIND_IGNORE" is > not needed. > > count_events_callback and select_event_lwp_callback in GDBServer need to > honour SIGILL and SIGSEGV too. I write a patch to call > lp_status_is_sigtrap_like_event in them, but regression test result > isn't changed, which is a surprise to me. I thought some fails should > be fixed. I'll look into it deeply. Maybe you're getting lucky with scheduling. pthreads.exp and schedlock.exp I think are the most sensitive to this. See: https://www.sourceware.org/ml/gdb-patches/2001-06/msg00250.html Thanks, Pedro Alves