From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 746 invoked by alias); 11 May 2012 20:29:02 -0000 Received: (qmail 736 invoked by uid 22791); 11 May 2012 20:29:01 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-qa0-f48.google.com (HELO mail-qa0-f48.google.com) (209.85.216.48) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 May 2012 20:28:49 +0000 Received: by qady23 with SMTP id y23so2175664qad.14 for ; Fri, 11 May 2012 13:28:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.201.5 with SMTP id ey5mr20360050qab.74.1336768128443; Fri, 11 May 2012 13:28:48 -0700 (PDT) Received: by 10.229.169.130 with HTTP; Fri, 11 May 2012 13:28:48 -0700 (PDT) In-Reply-To: <201205112025.q4BKP0fa012403@glazunov.sibelius.xs4all.nl> References: <20120511193114.GA5097@intel.com> <201205112025.q4BKP0fa012403@glazunov.sibelius.xs4all.nl> Date: Fri, 11 May 2012 20:29:00 -0000 Message-ID: Subject: Re: PATCH: Check DS segment register for x32 process From: "H.J. Lu" To: Mark Kettenis Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00450.txt.bz2 On Fri, May 11, 2012 at 1:25 PM, Mark Kettenis wr= ote: >> Date: Fri, 11 May 2012 12:31:14 -0700 >> From: "H.J. Lu" >> >> Hi, >> >> This patch checks DS segment register for x32 process. =A0Tested on >> Linux/x86-64. =A0OK to install? >> >> Thanks. >> >> H.J. >> --- >> =A0 =A0 =A0 * amd64-linux-nat.c (AMD64_LINUX_X32_DS): New. >> =A0 =A0 =A0 (amd64_linux_read_description): Check DS segment register for >> =A0 =A0 =A0 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 > >> + =A0if (sizeof (void *) =3D=3D 4 && is_64bit && !is_x32) >> + =A0 =A0error (_("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. Some x32 OSes don't have any 64bit binaries nor 64bit libraries. 32-bit x32 GDB work without any problems. --=20 H.J.