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.


Hello Yao,

I was creating the patch exactly in the way you described during early phases. But looks like the changes for boundaries have been added to the generic siginfo type on the kernel side. 
https://lkml.org/lkml/2014/9/11/977


Though in the general siginfo, the new fields are used only by MPX. 
I am considering that the right way is to adapt the general structure then. Is this ok?

Thanks and regards,
-Fred

-----Original Message-----
From: Yao Qi [mailto:qiyaoltc@gmail.com] 
Sent: Friday, July 17, 2015 5:41 PM
To: Tedeschi, Walfred
Cc: Joel Brobecker (brobecker@adacore.com); Yao Qi (qiyaoltc@gmail.com); Pedro Alves (palves@redhat.com); gdb@sourceware.org
Subject: 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 (éå)
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Prof. Dr. Hermann Eul
Chairperson of the Supervisory Board: Tiffany Doon Silva
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

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