From: Pedro Alves <palves@redhat.com>
To: "Tedeschi, Walfred" <walfred.tedeschi@intel.com>,
Joel Brobecker <brobecker@adacore.com>,
"Yao Qi <yao@codesourcery.com> (yao@codesourcery.com)"
<yao@codesourcery.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH v1] Synchronize siginfo type described in GDB with the kernel and glibc ones.
Date: Thu, 19 Nov 2015 17:07:00 -0000 [thread overview]
Message-ID: <564E01BC.4030402@redhat.com> (raw)
In-Reply-To: <AC542571535E904D8E8ADAE745D60B19444FC2A6@IRSMSX104.ger.corp.intel.com>
On 11/19/2015 04:40 PM, Tedeschi, Walfred wrote:
> Pedro,
>
> If I understood you right you are in favour of keeping the siginfo as global one?
> In case this is correct, I will start working on the code you pointed out.
I favor not querying whether the running x86 kernel supports the extra field.
But I wouldn't say I'm in favor of exposing the field in all targets -- more
like, if it's hard and we really want to be lazy, I see no real big harm in
making the change affect all archs, though I'd mildly prefer making the change
be x86-specific, like glibc did. I actually think it'd be simple. IIRC, Yao
already suggested how to do it without much changes. Simply rename the existing
linux_get_siginfo_type function, and add a new parameter that allows
saying "I want field X". Then the x86 version can install a siginfo type with
the field, while other ports not.
e.g.,
enum linux_siginfo_extra_field_values
{
LINUX_SIGINFO_FIELD_ADDR_BND = 1,
...
};
DEF_ENUM_FLAGS_TYPE (enum linux_siginfo_extra_field_values, linux_siginfo_extra_fields);
static struct type *
linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch,
linux_siginfo_extra_fields extra_fields)
{
...
if ((extra_fields & LINUX_SIGINFO_FIELD_ADDR_BND) != 0)
{
...
}
}
static struct type *
linux_get_siginfo_type (struct gdbarch *gdbarch)
{
return linux_get_siginfo_type_with_fields (gdbarch, 0);
}
x86:
x86_linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch,
linux_siginfo_extra_fields extra_fields)
{
return linux_get_siginfo_type_with_fields (gdbarch,
LINUX_SIGINFO_FIELD_ADDR_BND);
}
...
set_gdbarch_get_siginfo_type (gdbarch, x86_linux_get_siginfo_type_with_fields);
...
>
> What I could see from the glibc code the structure is reset via memset.
Actually, gdb reads the siginfo object out of the kernel directly, so whatever
glibc does has no bearing here. The question is whether the kernel really
shows garbage in those fields when si_code is not 3, or whether it always
pre-fills the siginfo objects (including the padding) with zeroes.
>
> Thanks a lot for your feedback!
> Muito obrigado!
You're welcome. De nada. ;-)
Thanks,
Pedro Alves
next prev parent reply other threads:[~2015-11-19 17:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 15:09 [PATCH obv] Changing compiler flags for MPX tests Walfred Tedeschi
2015-10-26 16:10 ` [PATCH v1] Intel(R) MPX registers to the DWARF enumeration Walfred Tedeschi
2015-12-06 16:35 ` Joel Brobecker
2015-12-06 17:42 ` H.J. Lu
2015-12-07 8:29 ` Tedeschi, Walfred
2015-10-26 16:11 ` [PATCH v1] Synchronize siginfo type described in GDB with the kernel and glibc ones Walfred Tedeschi
2015-11-18 23:01 ` Joel Brobecker
2015-11-19 9:52 ` Tedeschi, Walfred
2015-11-19 13:27 ` Pedro Alves
2015-11-19 16:41 ` Tedeschi, Walfred
2015-11-19 17:07 ` Pedro Alves [this message]
2015-12-01 10:08 ` Tedeschi, Walfred
2015-12-01 12:08 ` Pedro Alves
2015-10-26 16:22 ` [PATCH v1] ABI changes for Intel(R) MPX Walfred Tedeschi
2015-10-26 19:07 ` Eli Zaretskii
2015-10-27 17:21 ` Tedeschi, Walfred
2015-12-06 16:16 ` Joel Brobecker
2015-10-26 16:25 ` [PATCH obv] Fix non stopping breakpoint on newer compilers Walfred Tedeschi
2015-11-04 14:42 ` Joel Brobecker
2015-10-26 16:26 ` [PATCH v1] Intel(R) MPX - Bound violation handling Walfred Tedeschi
2015-11-04 14:55 ` Joel Brobecker
2015-11-05 10:04 ` Tedeschi, Walfred
2015-11-19 0:01 ` Joel Brobecker
2015-12-14 17:43 ` Tedeschi, Walfred
2015-12-14 18:45 ` Pedro Alves
2015-12-15 11:01 ` Tedeschi, Walfred
2015-12-16 15:21 ` Tedeschi, Walfred
2015-12-16 16:52 ` Pedro Alves
2015-12-17 17:31 ` Tedeschi, Walfred
2015-12-21 17:23 ` Pedro Alves
2015-11-04 14:42 ` [PATCH obv] Changing compiler flags for MPX tests Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=564E01BC.4030402@redhat.com \
--to=palves@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=walfred.tedeschi@intel.com \
--cc=yao@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox