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

"Tedeschi, Walfred" <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <AC542571535E904D8E8ADAE745D60B194444F431@IRSMSX104.ger.corp.intel.com>
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:[email protected]] 
Sent: Friday, July 17, 2015 5:41 PM
To: Tedeschi, Walfred
Cc: Joel Brobecker ([email protected]); Yao Qi ([email protected]); Pedro Alves ([email protected]); [email protected]
Subject: Re: New siginfo type in kernel how to make gdb back compatible.

"Tedeschi, Walfred" <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.