From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 9F8FB3858401 for ; Sat, 8 Jan 2022 11:03:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9F8FB3858401 Received: by mail-wr1-x42c.google.com with SMTP id v6so16109464wra.8 for ; Sat, 08 Jan 2022 03:03:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jj2Wd5Vyxq4ZXOoo4fBwCNjCoy0sVCXdnIAchv3mHn4=; b=Jvt8n84qQJx+D7GprAhzYrI9C953Z9XRz8/+qd5dt+GxafmBfsfIECZLBMzP4SySW6 bZxCEJQNjUBqK1QVoPN+KPS1d+pLHGTuEMP11Vl02QDc8U1KXIqzMWqK6wDB5sAG2Q5H xfto9eNKqZusBjuI5Hxp+Guq2E3BqXf6PAXwN8EE9wBP117zVr0p+qnQe+zMbPxEYbbU AMTkMX3gZoFKfm4D0HZcmluv01EbjGhqqueRWc1LqSRJ5RZy1DoMvFuwPbFLjUTDWC3o 465xy9V5TKQuSrhOi503pdRGQb3A+iZmR+gRk4J19So5pS23NjcmxXjh/bbG4F/OnPb9 wxow== X-Gm-Message-State: AOAM530CD31QPW0oK89+T53yLNGGJy/ZXGg+D4fm/FtRMO0TJSwnS/RE D2IiVsmx1wy59Oar7nWB1Uz0W/dlkmSY X-Google-Smtp-Source: ABdhPJyfKFf757Jgncfm3eXlToCSehFpvazfBApg7dYnbzkr9ww196FtWc3Ipy3wbyBZ7VoRdSEWCQ== X-Received: by 2002:a5d:55c5:: with SMTP id i5mr56086191wrw.445.1641639814798; Sat, 08 Jan 2022 03:03:34 -0800 (PST) Received: from takamaka.home ([2a01:cb22:1d5:1100:550:722f:8674:7cf5]) by smtp.gmail.com with ESMTPSA id g9sm1216955wmq.22.2022.01.08.03.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jan 2022 03:03:34 -0800 (PST) Received: by takamaka.home (Postfix, from userid 1000) id E0940A4A59; Sat, 8 Jan 2022 15:03:31 +0400 (+04) Date: Sat, 8 Jan 2022 15:03:31 +0400 From: Joel Brobecker To: Hannes Domani via Gdb-patches Cc: Joel Brobecker Subject: Re: [PATCH] Add _sigsys info to siginfo struct Message-ID: References: <20220103185854.1675-1-ssbssa.ref@yahoo.de> <20220103185854.1675-1-ssbssa@yahoo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220103185854.1675-1-ssbssa@yahoo.de> X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Sat, 08 Jan 2022 11:03:37 -0000 Hi Hannes, On Mon, Jan 03, 2022 at 07:58:54PM +0100, Hannes Domani via Gdb-patches wrote: > This patch adds information about _sigsys structure from newer > kernels, so that $_siginfo decoding can show information about > _sigsys, making it easier for developers to debug seccomp failures. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24283 Thanks for the patch. I'm trusting you for the proper definition of the various fields. This looks reasonable to me, but before we push this, I'm wondering what happens when debugging on a kernel which does not support this feature? Is the data undefined? If yes, do we a precendent for this already? > --- > gdb/linux-tdep.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c > index 927e69bf1e1..fb2abdd1a21 100644 > --- a/gdb/linux-tdep.c > +++ b/gdb/linux-tdep.c > @@ -379,6 +379,13 @@ linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch, > append_composite_type_field (type, "si_fd", int_type); > append_composite_type_field (sifields_type, "_sigpoll", type); > > + /* _sigsys */ > + type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); > + append_composite_type_field (type, "_call_addr", void_ptr_type); > + append_composite_type_field (type, "_syscall", int_type); > + append_composite_type_field (type, "_arch", uint_type); > + append_composite_type_field (sifields_type, "_sigsys", type); > + > /* struct siginfo */ > siginfo_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT); > siginfo_type->set_name (xstrdup ("siginfo")); > -- > 2.34.1 > -- Joel