public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Hannes Domani via Gdb-patches <gdb-patches@sourceware.org>
Cc: Joel Brobecker <brobecker@adacore.com>
Subject: Re: [PATCH] Add _sigsys info to siginfo struct
Date: Sat, 8 Jan 2022 15:03:31 +0400	[thread overview]
Message-ID: <Ydlvg/nvkfb1zrY4@adacore.com> (raw)
In-Reply-To: <20220103185854.1675-1-ssbssa@yahoo.de>

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

  reply	other threads:[~2022-01-08 11:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220103185854.1675-1-ssbssa.ref@yahoo.de>
2022-01-03 18:58 ` Hannes Domani
2022-01-08 11:03   ` Joel Brobecker [this message]
2022-01-08 12:34     ` Hannes Domani
2022-01-08 12:44       ` Joel Brobecker
2022-01-08 13:18         ` Hannes Domani
2022-01-10 15:12   ` Tom Tromey
2022-01-16  9:39     ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ydlvg/nvkfb1zrY4@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).