This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: New siginfo type in kernel how to make gdb back compatible.
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: "Tedeschi\, Walfred" <walfred dot tedeschi at intel dot com>
- Cc: "Joel Brobecker \(brobecker\ at adacore dot com\)" <brobecker at adacore dot com>, "Yao Qi \(qiyaoltc\ at gmail dot com\)" <qiyaoltc at gmail dot com>, "Pedro Alves \(palves\ at redhat dot com\)" <palves at redhat dot com>, "gdb\ at sourceware dot org" <gdb at sourceware dot org>
- Date: Fri, 17 Jul 2015 16:40:46 +0100
- Subject: Re: New siginfo type in kernel how to make gdb back compatible.
- Authentication-results: sourceware.org; auth=none
- References: <AC542571535E904D8E8ADAE745D60B194444ED12 at IRSMSX104 dot ger dot corp dot intel dot com>
"Tedeschi, Walfred" <walfred.tedeschi@intel.com> writes:
> GDB should be nevertheless back compatible, i.e. capable of displaying the siginfo for applications running on systems having older glibc.
>
> In case this is desirable and I do think it is.
>
> How should we think about resolving that in terms of the siginfo type redefined inside of GDB?
GDB creates a type for "struct siginfo" in
linux-tdep.c:linux_get_siginfo_type, and it should work well on both old
kernel and new kernel, because the new fields are added the end of
_sigfault.
If you want to show these new added fields $_siginfo, then, I am not
very sure. How are these two fields used? Are they only used when MPX
is enabled in linux kernel? If so probably we can overwrite the default
linux one (linux_get_siginfo_type) with a new one
(linux_get_siginfo_type_1, for example) if i386_mpx_enabled is true.
linux_get_siginfo_type_1 returns the type with new fields, and we call
set_gdbarch_get_siginfo_type in i386_linux_init_abi like this,
if (i386_mpx_enabled)
set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type_1);
--
Yao (éå)