This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PATCH: Check DS segment register for x32 process
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: hjl dot tools at gmail dot com
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 11 May 2012 22:25:00 +0200 (CEST)
- Subject: Re: PATCH: Check DS segment register for x32 process
- References: <20120511193114.GA5097@intel.com>
> Date: Fri, 11 May 2012 12:31:14 -0700
> From: "H.J. Lu" <hongjiu.lu@intel.com>
>
> Hi,
>
> This patch checks DS segment register for x32 process. Tested on
> Linux/x86-64. OK to install?
>
> Thanks.
>
> H.J.
> ---
> * amd64-linux-nat.c (AMD64_LINUX_X32_DS): New.
> (amd64_linux_read_description): Check DS segment register for
> x32 process.
>
> diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
> index 3be8404..97c9a49 100644
> --- a/gdb/amd64-linux-nat.c
> +++ b/gdb/amd64-linux-nat.c
> + if (sizeof (void *) == 4 && is_64bit && !is_x32)
> + error (_("Can't debug 64-bit process with 32-bit GDB"));
I really think we should refuse to even build a GDB as an X32 binary.