This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix sizes and types of x86 segment and x87 registers
- From: John Baldwin <jhb at FreeBSD dot org>
- To: Ruslan Kabatsayev <b7 dot 10110111 at gmail dot com>, gdb-patches at sourceware dot org
- Date: Thu, 5 Mar 2020 13:32:09 -0800
- Subject: Re: [PATCH] Fix sizes and types of x86 segment and x87 registers
- References: <20200201184318.25049-1-b7.10110111@gmail.com>
On 2/1/20 10:43 AM, Ruslan Kabatsayev wrote:
> Segment registers are actually 16-bit, and their upper bit doesn't have
> the meaning of sign. Currently GDB instead thinks they are signed
> 32-bit, which makes various debugger front-ends (e.g. QtCreator) display
> them in unnatural format like 00000023.
>
> Similar consideration applies to various x87 non-data registers. In
> addition, fioff and fooff on IA32 are conceptually pointers, so the
> command like "p $fioff" should show them as such, not as decimal
> integers. On x86-64 fioff and fooff are not as straightforward, being
> only the lower parts of the 48-bit offsets, upper part of which is in
> fiseg and foseg, respectively, so this easy type assignment can't be
> done.
>
> This patch fixes types and sizes of these 16-bit registers to unsigned
> 16-bit, and makes types of fioff and fooff on IA32 respectively code_ptr
> and data_ptr (on x86_64 both are made uint32).
I'd be happy to see these fixed (segment regs in particular), but I had
worried that this might break any debug stubs that aren't using XML target
descriptions to describe the layout of 'g'?
--
John Baldwin