From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UDYHIhSEtWAcTQAAWB0awg (envelope-from ) for ; Mon, 31 May 2021 20:49:24 -0400 Received: by simark.ca (Postfix, from userid 112) id 897E81F163; Mon, 31 May 2021 20:49:24 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 71C591E01F for ; Mon, 31 May 2021 20:49:23 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BD161385E440; Tue, 1 Jun 2021 00:49:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD161385E440 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1622508562; bh=yBAp/rznaCqlhpYFtYb2XG/ydzN72dGsnMr+sSQXLQc=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=OtWeKzca9O/iV3koYO4j1m1s9S+MK8TS9Tw8Y7fbjMUCq9Yh9YotWqMcSjXdaWSJ1 zfIZ8j7TMf6EZADcFOFAgGgqr3p0tknQ5icfq2u8W+i4J2UadPfDc1PANg3ow58nAI XPDYSt3NXTGuWCPPP8JbQk+QFDbCQNLiOKj3ai6U= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id EA7D3385E440 for ; Tue, 1 Jun 2021 00:49:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EA7D3385E440 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 1510nBk4029755 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 May 2021 20:49:16 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1510nBk4029755 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id AEC3D1E01F; Mon, 31 May 2021 20:49:11 -0400 (EDT) Subject: Re: [PATCH] Report additional details for signals received on FreeBSD. To: John Baldwin , gdb-patches@sourceware.org References: <20210531162940.10841-1-jhb@FreeBSD.org> <46124956-89f0-4da0-00cd-476584b50e98@FreeBSD.org> Message-ID: Date: Mon, 31 May 2021 20:49:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <46124956-89f0-4da0-00cd-476584b50e98@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 1 Jun 2021 00:49:11 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-05-31 12:33 p.m., John Baldwin wrote: > On 5/31/21 9:29 AM, John Baldwin wrote: >> Provide a description for si_code values as a sigcode-meaning field. >> For signals raised by a system call, provide the pid and user ID of >> the sending process. For signals raised by a POSIX timer exparation, >> provide the id of the timer. For signals raised by a POSIX message >> queue, provide the id of the message queue. For SIGCHLD provide the >> pid and user ID of the child process along with the exit status or >> relevant signal number. >> >> gdb/ChangeLog: >> >> * fbsd-tdep.c (fbsd_signal_cause, fbsd_report_signal_info): New. >> (fbsd_init_abi): Use fbsd_report_signal_info as gdbarch >> report_signal_info method. >> --- >> gdb/ChangeLog | 6 ++ >> gdb/fbsd-tdep.c | 272 ++++++++++++++++++++++++++++++++++++++++++++++++ >> 2 files changed, 278 insertions(+) >> >> diff --git a/gdb/ChangeLog b/gdb/ChangeLog >> index b0f448a35e..0f5ec65680 100644 >> --- a/gdb/ChangeLog >> +++ b/gdb/ChangeLog >> @@ -1,3 +1,9 @@ >> +2021-05-30 John Baldwin >> + >> + * fbsd-tdep.c (fbsd_signal_cause, fbsd_report_signal_info): New. >> + (fbsd_init_abi): Use fbsd_report_signal_info as gdbarch >> + report_signal_info method. >> + >> 2021-05-30 John Baldwin >> * infrun.c (handle_inferior_event): Only call >> diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c >> index 6cab31dde8..3fe4c5c595 100644 >> --- a/gdb/fbsd-tdep.c >> +++ b/gdb/fbsd-tdep.c >> @@ -75,6 +75,63 @@ enum >> FREEBSD_SIGRTMAX = 126, >> }; >> +/* Constants for values of si_code as defined in FreeBSD's >> + . */ >> + >> +#define FBSD_SI_USER 0x10001 >> +#define FBSD_SI_QUEUE 0x10002 >> +#define FBSD_SI_TIMER 0x10003 >> +#define FBSD_SI_ASYNCIO 0x10004 >> +#define FBSD_SI_MESGQ 0x10005 >> +#define FBSD_SI_KERNEL 0x10006 >> +#define FBSD_SI_LWP 0x10007 >> + >> +#define FBSD_ILL_ILLOPC 1 >> +#define FBSD_ILL_ILLOPN 2 >> +#define FBSD_ILL_ILLADR 3 >> +#define FBSD_ILL_ILLTRP 4 >> +#define FBSD_ILL_PRVOPC 5 >> +#define FBSD_ILL_PRVREG 6 >> +#define FBSD_ILL_COPROC 7 >> +#define FBSD_ILL_BADSTK 8 >> + >> +#define FBSD_BUS_ADRALN 1 >> +#define FBSD_BUS_ADRERR 2 >> +#define FBSD_BUS_OBJERR 3 >> +#define FBSD_BUS_OOMERR 100 >> + >> +#define FBSD_SEGV_MAPERR 1 >> +#define FBSD_SEGV_ACCERR 2 >> +#define FBSD_SEGV_PKUERR 100 >> + >> +#define FBSD_FPE_INTOVF 1 >> +#define FBSD_FPE_INTDIV 2 >> +#define FBSD_FPE_FLTDIV 3 >> +#define FBSD_FPE_FLTOVF 4 >> +#define FBSD_FPE_FLTUND 5 >> +#define FBSD_FPE_FLTRES 6 >> +#define FBSD_FPE_FLTINV 7 >> +#define FBSD_FPE_FLTSUB 8 >> + >> +#define FBSD_TRAP_BRKPT 1 >> +#define FBSD_TRAP_TRACE 2 >> +#define FBSD_TRAP_DTRACE 3 >> +#define FBSD_TRAP_CAP 4 >> + >> +#define FBSD_CLD_EXITED 1 >> +#define FBSD_CLD_KILLED 2 >> +#define FBSD_CLD_DUMPED 3 >> +#define FBSD_CLD_TRAPPED 4 >> +#define FBSD_CLD_STOPPED 5 >> +#define FBSD_CLD_CONTINUED 6 >> + >> +#define FBSD_POLL_IN 1 >> +#define FBSD_POLL_OUT 2 >> +#define FBSD_POLL_MSG 3 >> +#define FBSD_POLL_ERR 4 >> +#define FBSD_POLL_PRI 5 >> +#define FBSD_POLL_HUP 6 > > Do I need to list all of these new #define's individually in the changelog > or is there a more concise way to list them? I don't really have an opinion. But you can probably automate a bit of it with grep / sed. In any case the patch LGTM. It would be nice if you could include an example output for one of the cases, to get an idea of the user-visible improvement. Simon