From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15003 invoked by alias); 14 Nov 2004 01:10:25 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 14964 invoked from network); 14 Nov 2004 01:10:21 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 14 Nov 2004 01:10:21 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id iAE1ALQJ005011 for ; Sat, 13 Nov 2004 20:10:21 -0500 Received: from localhost.redhat.com (vpn50-32.rdu.redhat.com [172.16.50.32]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id iAE1AKr16068; Sat, 13 Nov 2004 20:10:20 -0500 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 66CA0129D8C; Sat, 13 Nov 2004 20:08:53 -0500 (EST) Message-ID: <4196B023.2080505@gnu.org> Date: Sun, 14 Nov 2004 01:10:00 -0000 From: Andrew Cagney User-Agent: Mozilla Thunderbird 0.8 (X11/20041020) MIME-Version: 1.0 To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/RFC/IRIX] remove last uses of deprecated_registers in irix5-nat References: <20041113232716.GA32567@gnat.com> In-Reply-To: <20041113232716.GA32567@gnat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-11/txt/msg00299.txt.bz2 Joel Brobecker wrote: > This patch deals with the last 2 instances of deprecated_registers > found in irix5-nat.c: > > 2004-11-13 Joel Brobecker > > * irix5-nat.c (fetch_core_registers): Replace use of > deprecated_registers by equivalent code. > > Tested on mips-irix using corefile.exp. No regression. > > Given that Andrew gave me a green light for the previous patch > (http://sources.redhat.com/ml/gdb-patches/2004-11/msg00292.html) > and followup patches, I will commit this change. But don't hesitate > to send tomatoes I me if I botched something. Go for it! Andrew > --- irix5-nat.c.orig 2004-11-13 17:31:39.631455281 -0500 > +++ irix5-nat.c 2004-11-13 18:17:08.214095369 -0500 > @@ -221,52 +221,33 @@ static void > fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, > int which, CORE_ADDR reg_addr) > { > + char *srcp = core_reg_sect; > + int regno; > + > if (core_reg_size == deprecated_register_bytes ()) > { > - memcpy ((char *) deprecated_registers, core_reg_sect, core_reg_size); > + for (regno = 0; regno < NUM_REGS; regno++) > + { > + regcache_raw_write (current_regcache, regno, srcp); > + srcp += register_size (current_gdbarch, regno); > + } > } > else if (mips_isa_regsize (current_gdbarch) == 4 && > core_reg_size == (2 * mips_isa_regsize (current_gdbarch)) * NUM_REGS) > { > /* This is a core file from a N32 executable, 64 bits are saved > for all registers. */ > - char *srcp = core_reg_sect; > - char *dstp = deprecated_registers; > - int regno; > - > for (regno = 0; regno < NUM_REGS; regno++) > { > if (regno >= FP0_REGNUM && regno < (FP0_REGNUM + 32)) > { > - /* FIXME, this is wrong, N32 has 64 bit FP regs, but GDB > - currently assumes that they are 32 bit. */ > - *dstp++ = *srcp++; > - *dstp++ = *srcp++; > - *dstp++ = *srcp++; > - *dstp++ = *srcp++; > - if (register_size (current_gdbarch, regno) == 4) > - { > - /* copying 4 bytes from eight bytes? > - I don't see how this can be right... */ > - srcp += 4; > - } > - else > - { > - /* copy all 8 bytes (sizeof(double)) */ > - *dstp++ = *srcp++; > - *dstp++ = *srcp++; > - *dstp++ = *srcp++; > - *dstp++ = *srcp++; > - } > + regcache_raw_write (current_regcache, regno, srcp); > } > else > { > - srcp += 4; > - *dstp++ = *srcp++; > - *dstp++ = *srcp++; > - *dstp++ = *srcp++; > - *dstp++ = *srcp++; > + regcache_raw_write (current_regcache, regno, srcp + 4); > } > + srcp += 8; > } > } > else > @@ -274,8 +255,6 @@ fetch_core_registers (char *core_reg_sec > warning ("wrong size gregset struct in core file"); > return; > } > - > - deprecated_registers_fetched (); > } > > /* Register that we are able to handle irix5 core file formats.