From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iKjiLeUPtWB6PgAAWB0awg (envelope-from ) for ; Mon, 31 May 2021 12:33:41 -0400 Received: by simark.ca (Postfix, from userid 112) id B9D091F163; Mon, 31 May 2021 12:33:41 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=MAILING_LIST_MULTI, RDNS_DYNAMIC autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 07C4C1E54D for ; Mon, 31 May 2021 12:33:41 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF3BC385783A; Mon, 31 May 2021 16:33:40 +0000 (GMT) Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by sourceware.org (Postfix) with ESMTPS id 166DD3857C5F for ; Mon, 31 May 2021 16:33:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 166DD3857C5F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jhb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id C6998970DB for ; Mon, 31 May 2021 16:33:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fv17f4TRzz4Sp3 for ; Mon, 31 May 2021 16:33:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:356c:7359:993:ef34]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4E639FA64 for ; Mon, 31 May 2021 16:33:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: [PATCH] Report additional details for signals received on FreeBSD. From: John Baldwin To: gdb-patches@sourceware.org References: <20210531162940.10841-1-jhb@FreeBSD.org> Message-ID: <46124956-89f0-4da0-00cd-476584b50e98@FreeBSD.org> Date: Mon, 31 May 2021 09:33:33 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210531162940.10841-1-jhb@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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? -- John Baldwin