From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 699 invoked by alias); 22 Apr 2010 20:21:48 -0000 Received: (qmail 672 invoked by uid 22791); 22 Apr 2010 20:21:44 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Apr 2010 20:21:40 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id o3MKLZ7H013480; Thu, 22 Apr 2010 22:21:35 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id o3MKLYSh017913; Thu, 22 Apr 2010 22:21:34 +0200 (CEST) Date: Thu, 22 Apr 2010 20:21:00 -0000 Message-Id: <201004222021.o3MKLYSh017913@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: hjl.tools@gmail.com CC: mark.kettenis@xs4all.nl, gdb-patches@sourceware.org In-reply-to: (hjl.tools@gmail.com) Subject: Re: PATCH: Remove amd64_linux_gregset64_reg_offset and regmap References: <20100421230929.GA11193@intel.com> <201004221948.o3MJmAnH030821@glazunov.sibelius.xs4all.nl> 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: 2010-04/txt/msg00765.txt.bz2 > Date: Thu, 22 Apr 2010 13:12:08 -0700 > From: "H.J. Lu" > > On Thu, Apr 22, 2010 at 12:48 PM, Mark Kettenis wrote: > >> Date: Wed, 21 Apr 2010 16:09:29 -0700 > >> From: "H.J. Lu" > >> > >> Hi, > >> > >> As we have discussed, this patch removes amd64_linux_gregset64_reg_offset > >> and regmap from i386/amd64 Linux targets.  OK to install? > > > > The amd64 bits are ok.  A small issue with the i386 bits below. > >> diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c > >> index d559811..35bc3bd 100644 > >> --- a/gdb/i386-linux-nat.c > >> +++ b/gdb/i386-linux-nat.c > >> @@ -245,18 +228,19 @@ void > >>  fill_gregset (const struct regcache *regcache, > >>             elf_gregset_t *gregsetp, int regno) > >>  { > >> -  elf_greg_t *regp = (elf_greg_t *) gregsetp; > >> +  gdb_byte *regp = (gdb_byte *) gregsetp; > >>    int i; > >> > >>    for (i = 0; i < I386_NUM_GREGS; i++) > >>      if (regno == -1 || regno == i) > >> -      regcache_raw_collect (regcache, i, regp + regmap[i]); > >> +      regcache_raw_collect (regcache, i, > >> +                         regp + i386_linux_gregset_reg_offset[i]); > >> > >>    if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM) > >>        && I386_LINUX_ORIG_EAX_REGNUM > >>          < gdbarch_num_regs (get_regcache_arch (regcache))) > >>      regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM, > >> -                       regp + ORIG_EAX); > >> +                       regp + 4 * ORIG_EAX); > > > > I think this should use an offset from i386_linux_gregset_reg_offset[] > > as well. > > > > Like this? Yeah, the long line is a bit of a pity, but yes, I think that's better. > diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c > index 35bc3bd..eba0b6a 100644 > --- a/gdb/i386-linux-nat.c > +++ b/gdb/i386-linux-nat.c > @@ -217,7 +217,7 @@ supply_gregset (struct regcache *regcache, const > elf_gregset_t *gregsetp) > if (I386_LINUX_ORIG_EAX_REGNUM > < gdbarch_num_regs (get_regcache_arch (regcache))) > regcache_raw_supply (regcache, I386_LINUX_ORIG_EAX_REGNUM, > - regp + ORIG_EAX); > + regp + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]); > } > > /* Fill register REGNO (if it is a general-purpose register) in > @@ -240,7 +240,7 @@ fill_gregset (const struct regcache *regcache, > && I386_LINUX_ORIG_EAX_REGNUM > < gdbarch_num_regs (get_regcache_arch (regcache))) > regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM, > - regp + ORIG_EAX); > + regp + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]); > } > > #ifdef HAVE_PTRACE_GETREGS > > > -- > H.J. > >