Add _sigsys info to siginfo struct
authorHannes Domani <ssbssa@yahoo.de>
Tue, 7 Apr 2020 18:57:07 +0000 (20:57 +0200)
committerHannes Domani <ssbssa@yahoo.de>
Sat, 8 Jan 2022 13:17:49 +0000 (14:17 +0100)
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

gdb/linux-tdep.c

index 45e7e1d0b54ea65711b72e81d327b7db04fac58a..b0056358cf9205e9af70657fa6ba9fc841893995 100644 (file)
@@ -380,6 +380,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"));