From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Invalid segment resister value on x86_64-windows
Date: Tue, 01 May 2012 23:04:00 -0000 [thread overview]
Message-ID: <1335913461-1628-1-git-send-email-brobecker@adacore.com> (raw)
Hello,
One of our customers noticed that GDB was displaying invalid values
for the ss & gs register. It's obviously invalid because the value
was wider than the registers' size (16 bits). I noticed that the XML
files define these register as being 32bit, which I am assuming was
an oversight (?).
As a result of the 32bit size, GDB was reading the value of these
registers as 4 bytes, instead of just 2. On GNU/Linux, I did not
check the kernel sources, but it appears that it was harmless,
because the extra bytes were always zero. But on some Windows
systems, we werent' that lucky. The extra 2 bytes were not null,
and thus we ended up with a polluted value.
This patch series first regenerates the .c files in features/i386,
because I noticed a difference between the current files and the
generated version. And the second patch changes the size of all
segment registers to match the size found in the various reference
manuals.
The series was tested on x86_64-linux, standalone and then with
gdbserver. I also checked by hand that the new GDB is still able
to work with an older GDBserver (thanks to the fact that GDBserver
sends the target description to GDB). And I also tested this patch
on x86_64-windows, using AdaCore's testsuite.
next reply other threads:[~2012-05-01 23:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-01 23:04 Joel Brobecker [this message]
2012-05-01 23:04 ` [RFA/commit 1/2] Regenerate the features/i386 target description .c files Joel Brobecker
2012-05-02 6:34 ` Sergio Durigan Junior
2012-05-01 23:05 ` [RFA 2/2] [x86/x86_64] Segment registers are 16 bits long (not 32bits) Joel Brobecker
2012-05-02 0:01 ` [RFA 3/2(+)] Test size of x86/x86_64 segment registers Joel Brobecker
2012-05-02 10:10 ` Invalid segment resister value on x86_64-windows Mark Kettenis
2012-05-02 17:57 ` Joel Brobecker
2012-05-02 20:45 ` Mark Kettenis
2012-05-02 21:26 ` Joel Brobecker
2012-05-02 21:27 ` Joel Brobecker
2012-05-02 21:50 ` Mark Kettenis
2012-05-02 21:58 ` [WINDOWS/RFC] " Joel Brobecker
2012-05-02 22:10 ` Christopher Faylor
2012-05-02 22:16 ` Christopher Faylor
2012-05-04 18:38 ` checked in: " 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=1335913461-1628-1-git-send-email-brobecker@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/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