newer kernels have a _sigsys structure: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/siginfo.h?h=v4.20#n103 /* SIGSYS */ struct { void __user *_call_addr; /* calling user insn */ int _syscall; /* triggering system call number */ unsigned int _arch; /* AUDIT_ARCH_* of syscall */ } _sigsys; this helps a lot when debugging seccomp failures. i guess gdb/linux-tdep.c:linux_get_siginfo_type_with_fields needs updating. i've never played with this section of code before, so throwing up a feature bug so it doesn't get lost.
I think it should be as simple as that: --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -350,6 +350,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); TYPE_NAME (siginfo_type) = xstrdup ("siginfo"); But I don't have Linux, so I can't test it.
looks like we've had someone test it on our side: https://crrev.com/c/2745853 can you send your patch to the mailing list since you're the author ?
The master branch has been updated by Hannes Domani <ssbssa@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=24fe764c8a14bd519826e7e9af01edff59ab6be3 commit 24fe764c8a14bd519826e7e9af01edff59ab6be3 Author: Hannes Domani <ssbssa@yahoo.de> Date: Tue Apr 7 20:57:07 2020 +0200 Add _sigsys info to siginfo struct 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. Requested in PR gdb/24283. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24283
Fixed.