This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New siginfo type in kernel how to make gdb back compatible.


"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 (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]