From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29669 invoked by alias); 4 Jul 2012 20:51:35 -0000 Received: (qmail 29660 invoked by uid 22791); 4 Jul 2012 20:51:33 -0000 X-SWARE-Spam-Status: No, hits=-5.0 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-qc0-f169.google.com (HELO mail-qc0-f169.google.com) (209.85.216.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Jul 2012 20:51:20 +0000 Received: by qcsd16 with SMTP id d16so4957220qcs.0 for ; Wed, 04 Jul 2012 13:51:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.106.130 with SMTP id x2mr443464qco.121.1341435079686; Wed, 04 Jul 2012 13:51:19 -0700 (PDT) Received: by 10.229.192.129 with HTTP; Wed, 4 Jul 2012 13:51:19 -0700 (PDT) In-Reply-To: <201207041953.q64JrCBG024384@glazunov.sibelius.xs4all.nl> References: <20120621181452.GA23413@intel.com> <201207031408.q63E8DbR009742@glazunov.sibelius.xs4all.nl> <201207041953.q64JrCBG024384@glazunov.sibelius.xs4all.nl> Date: Wed, 04 Jul 2012 20:51:00 -0000 Message-ID: Subject: Re: [PATCH 1/3] Add sp_regnum_from_eax and pc_regnum_from_eax 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-07/txt/msg00063.txt.bz2 On Wed, Jul 4, 2012 at 12:53 PM, Mark Kettenis wr= ote: >> Date: Tue, 3 Jul 2012 16:55:59 -0700 >> From: "H.J. Lu" >> >> On Tue, Jul 3, 2012 at 12:14 PM, H.J. Lu wrote: >> > On Tue, Jul 3, 2012 at 10:35 AM, H.J. Lu wrote: >> >> On Tue, Jul 3, 2012 at 8:54 AM, H.J. Lu wrote: >> >>> On Tue, Jul 3, 2012 at 7:08 AM, Mark Kettenis wrote: >> >>>>> Date: Thu, 21 Jun 2012 11:14:52 -0700 >> >>>>> From: "H.J. Lu" >> >>>>> >> >>>>> Hi, >> >>>>> >> >>>>> Here are the first of the last 3 patches for x32 support in GDB. = =A0This >> >>>>> patch maps $pc to $eip and $sp to $esp for x32. =A0OK to install? >> >>>> >> >>>> The pseudo register handling code is getting too complex :(. =A0I f= eel >> >>>> that hiding the set_gdbarch_pc_regnum() and set_gdbarch_sp_regnum() >> >>>> calls in i386-tdep.c isn't the right approach. =A0But I haven't fou= nd a >> >>>> better one yet :(. >> >>>> >> >>> >> >>> One possibility is to set pc/sp to register name instead of regnum. >> >>> i386_gdbarch_init can map them to regnum after all pseudo registers >> >>> are finalized. >> >>> >> >>> -- >> >>> H.J. >> >> >> >> How about this patch? I can also change amd64 and i386 >> >> to use "rsp/"rsp"/"esp"/"eip". >> >> >> > >> > This patch sets SP?PC regnums from register names. >> > >> > >> >> Here is another approach to set SP/PC regnums after >> setting up pseudo registers. > > I've come to the conclusion that the speudo register handling in > i386/amd64 needs some serious surgery. =A0I think your origional diff: > > http://sourceware.org/ml/gdb-patches/2012-06/msg00664.html > > is the least invasive. =A0Can you commit that one? > Done. This is the last x32 patch for now. I checked in this patch to mention it in NEWS. Thanks. --=20 H.J. -- Index: ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.14431 diff -u -p -r1.14431 ChangeLog --- ChangeLog 4 Jul 2012 20:46:18 -0000 1.14431 +++ ChangeLog 4 Jul 2012 20:49:14 -0000 @@ -1,5 +1,9 @@ 2012-07-04 H.J. Lu + * NEWS: Mention x32 ABI support. + +2012-07-04 H.J. Lu + * amd64-tdep.c (amd64_x32_init_abi): Set sp_regnum_from_eax to AMD64_RSP_REGNUM and pc_regnum_from_eax to AMD64_RIP_REGNUM. Index: NEWS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/NEWS,v retrieving revision 1.532 diff -u -p -r1.532 NEWS --- NEWS 2 Jul 2012 15:29:33 -0000 1.532 +++ NEWS 4 Jul 2012 20:49:14 -0000 @@ -3,6 +3,9 @@ *** Changes since GDB 7.4 +* GDB now supports x32 ABI. Visit + for more x32 ABI info. + * GDB now supports access to MIPS DSP registers on Linux targets. * GDB now supports debugging microMIPS binaries.