From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11668 invoked by alias); 13 Nov 2004 23:06:00 -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 11655 invoked from network); 13 Nov 2004 23:05:55 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 13 Nov 2004 23:05:55 -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 iADN5s8k012295 for ; Sat, 13 Nov 2004 18:05:55 -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 iADN5rr26152; Sat, 13 Nov 2004 18:05:54 -0500 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id B7D31129D8C; Sat, 13 Nov 2004 18:04:11 -0500 (EST) Message-ID: <419692EA.8000701@gnu.org> Date: Sat, 13 Nov 2004 23:06: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 some deprecated_registers from irix5-nat.c References: <20041113224227.GK935@gnat.com> In-Reply-To: <20041113224227.GK935@gnat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-11/txt/msg00294.txt.bz2 Joel Brobecker wrote: > Hello, > > Here is a patch that removes most of the uses of deprecated_registers > in irix5-nat.c. I am not too familiar with the regcache yet, I hope > I got it right. There was also a small issue with type size, where > I introduced a temporary (regval) to make sure that the buffer given > to regcache_raw_read_signed would always be large enough. Not sure > whether it was the best way to do it (this shows my lack of C knowledge). You should consider a patch fixing fallout from the deletion of deprecated_registers as "obvious". > 2004-11-13 Joel Brobecker > > * irix5-nat.c (fill_gregset): Replace use of deprecated_registers > with equivalent code. > (fill_fpregset): Likewise. > > Tested on mips-irix. There is an occasional screwup during the execution > of gdb.threads/killed.exp that causes the testsuite to abort before the > end: > > ERROR: (DejaGnu) proc "(gdb) {$}" does not exist. > The error code is NONE > The info on the error is: > close: invalid spawn id (8) > while executing > "close -i 8" > invoked from within > "catch "close -i $spawn_id"" > > Given that the testsuite takes a fair bit of time to run on our > IRIX machine, and given that it can happen several times in a row > before I get a clean run, I am reluctant to retry. > > So it's a bit more difficult to compare the two testsuite results. > But I verified that we didn't have any change in all the testsuite > up until this point. > > OK to apply? > > The last couple of uses of deprecated_registers will be removed shortly. > I decided to handle them separately because they are used when loading > the registers from a core file. I wanted to evaluate the attached change > first. And set your baseline at "does it build" (as with deprecated_registers deleted, it doesn't build yet alone run). (thanks for fixing this) Andrew > Thanks, > > > ------------------------------------------------------------------------ > > Index: irix5-nat.c > =================================================================== > RCS file: /cvs/src/src/gdb/irix5-nat.c,v > retrieving revision 1.35 > diff -u -p -r1.35 irix5-nat.c > --- irix5-nat.c 30 Oct 2004 22:36:34 -0000 1.35 > +++ irix5-nat.c 13 Nov 2004 22:33:07 -0000 > @@ -83,6 +83,7 @@ fill_gregset (gregset_t *gregsetp, int r > { > int regi; > greg_t *regp = &(*gregsetp)[0]; > + LONGEST regval; > > /* Under Irix6, if GDB is built with N32 ABI and is debugging an O32 > executable, we have to sign extend the registers to 64 bits before > @@ -90,30 +91,39 @@ fill_gregset (gregset_t *gregsetp, int r > > for (regi = 0; regi <= CTX_RA; regi++) > if ((regno == -1) || (regno == regi)) > - *(regp + regi) = > - extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)], > - register_size (current_gdbarch, regi)); > + { > + regcache_raw_read_signed (current_regcache, regi, ®val); > + *(regp + regi) = regval; > + } > > if ((regno == -1) || (regno == PC_REGNUM)) > - *(regp + CTX_EPC) = > - extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)], > - register_size (current_gdbarch, mips_regnum (current_gdbarch)->pc)); > + { > + regcache_raw_read_signed > + (current_regcache, mips_regnum (current_gdbarch)->pc, ®val); > + *(regp + CTX_EPC) = regval; > + } > > if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->cause)) > - *(regp + CTX_CAUSE) = > - extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->cause)], > - register_size (current_gdbarch, mips_regnum (current_gdbarch)->cause)); > + { > + regcache_raw_read_signed > + (current_regcache, mips_regnum (current_gdbarch)->cause, ®val); > + *(regp + CTX_CAUSE) = regval; > + } > > if ((regno == -1) > || (regno == mips_regnum (current_gdbarch)->hi)) > - *(regp + CTX_MDHI) = > - extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)], > - register_size (current_gdbarch, mips_regnum (current_gdbarch)->hi)); > + { > + regcache_raw_read_signed > + (current_regcache, mips_regnum (current_gdbarch)->hi, ®val); > + *(regp + CTX_MDHI) = regval; > + } > > if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->lo)) > - *(regp + CTX_MDLO) = > - extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)], > - register_size (current_gdbarch, mips_regnum (current_gdbarch)->lo)); > + { > + regcache_raw_read_signed > + (current_regcache, mips_regnum (current_gdbarch)->lo, ®val); > + *(regp + CTX_MDLO) = regval; > + } > } > > /* > @@ -158,15 +168,16 @@ fill_fpregset (fpregset_t *fpregsetp, in > { > if ((regno == -1) || (regno == regi)) > { > - from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)]; > to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]); > - memcpy (to, from, register_size (current_gdbarch, regi)); > + regcache_raw_read (current_regcache, regi, to); > } > } > > if ((regno == -1) > || (regno == mips_regnum (current_gdbarch)->fp_control_status)) > - fpregsetp->fp_csr = *(unsigned *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)]; > + regcache_raw_read (current_regcache, > + mips_regnum (current_gdbarch)->fp_control_status, > + &fpregsetp->fp_csr); > } > >