From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16951 invoked by alias); 3 Jun 2003 00:59:08 -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 16933 invoked from network); 3 Jun 2003 00:59:08 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 3 Jun 2003 00:59:08 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h530x7H06219 for ; Mon, 2 Jun 2003 20:59:08 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h530x6T12192; Mon, 2 Jun 2003 20:59:07 -0400 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id h530x6009923; Mon, 2 Jun 2003 17:59:06 -0700 Message-ID: <3EDBF2DA.C81FF90E@redhat.com> Date: Tue, 03 Jun 2003 00:59:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Jim Blandy CC: gdb-patches@sources.redhat.com Subject: Re: RFC: s390x: correct core file register layout References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg00103.txt.bz2 Jim Blandy wrote: > > 2003-05-23 Jim Blandy > > * s390-nat.c (supply_gregset, fill_gregset): On the s390x, the > elements of gregset_t are 64 bits each, but access registers > are still 32 bits, so they're packed two per gregset_t > element. Unpack/pack them properly. What sort of comment are you looking for? > Index: gdb/s390-nat.c > =================================================================== > RCS file: /cvs/src/src/gdb/s390-nat.c,v > retrieving revision 1.7 > diff -c -r1.7 s390-nat.c > *** gdb/s390-nat.c 14 Apr 2003 14:21:07 -0000 1.7 > --- gdb/s390-nat.c 23 May 2003 06:52:07 -0000 > *************** > *** 251,259 **** > for (regi = 0; regi < S390_NUM_GPRS; regi++) > supply_register (S390_GP0_REGNUM + regi, > (char *) &gregp[S390_GP0_REGNUM + regi]); > for (regi = 0; regi < S390_NUM_ACRS; regi++) > supply_register (S390_FIRST_ACR + regi, > ! (char *) &gregp[S390_FIRST_ACR + regi]); > /* unfortunately this isn't in gregsetp */ > for (regi = 0; regi < S390_NUM_CRS; regi++) > supply_register (S390_FIRST_CR + regi, NULL); > --- 251,276 ---- > for (regi = 0; regi < S390_NUM_GPRS; regi++) > supply_register (S390_GP0_REGNUM + regi, > (char *) &gregp[S390_GP0_REGNUM + regi]); > + > + #if defined (CONFIG_ARCH_S390X) > + /* On the s390x, each element of gregset_t is 8 bytes long, but > + each access register is still only 32 bits long. So they're > + packed two per element. It's apparently traditional that > + gregset_t must be an array, so when the registers it provides > + have different sizes, something has to get strange > + somewhere. */ > + { > + unsigned int *acrs = (unsigned int *) &gregp[S390_FIRST_ACR]; > + > + for (regi = 0; regi < S390_NUM_ACRS; regi++) > + supply_register (S390_FIRST_ACR + regi, (char *) &acrs[regi]); > + } > + #else > for (regi = 0; regi < S390_NUM_ACRS; regi++) > supply_register (S390_FIRST_ACR + regi, > ! (char *) &gregp[S390_FIRST_ACR + regi]); > ! #endif > ! > /* unfortunately this isn't in gregsetp */ > for (regi = 0; regi < S390_NUM_CRS; regi++) > supply_register (S390_FIRST_CR + regi, NULL); > *************** > *** 284,295 **** > for (regi = 0; regi < S390_NUM_GPRS; regi++) > regcache_collect (S390_GP0_REGNUM + regi, > &gregp[S390_GP0_REGNUM + regi]); > for (regi = 0; regi < S390_NUM_ACRS; regi++) > regcache_collect (S390_FIRST_ACR + regi, > &gregp[S390_FIRST_ACR + regi]); > } > ! else if (regno >= S390_PSWM_REGNUM && regno <= S390_LAST_ACR) > regcache_collect (regno, &gregp[regno]); > } > > /* Given a pointer to a floating point register set in /proc format > --- 301,335 ---- > for (regi = 0; regi < S390_NUM_GPRS; regi++) > regcache_collect (S390_GP0_REGNUM + regi, > &gregp[S390_GP0_REGNUM + regi]); > + #if defined (CONFIG_ARCH_S390X) > + /* See the comments about the access registers in > + supply_gregset, above. */ > + { > + unsigned int *acrs = (unsigned int *) &gregp[S390_FIRST_ACR]; > + > + for (regi = 0; regi < S390_NUM_ACRS; regi++) > + regcache_collect (S390_FIRST_ACR + regi, &acrs[regi]); > + } > + #else > for (regi = 0; regi < S390_NUM_ACRS; regi++) > regcache_collect (S390_FIRST_ACR + regi, > &gregp[S390_FIRST_ACR + regi]); > + #endif > } > ! else if (regno >= S390_PSWM_REGNUM && regno < S390_FIRST_ACR) > regcache_collect (regno, &gregp[regno]); > + else if (regno >= S390_FIRST_ACR && regno <= S390_LAST_ACR) > + { > + #if defined (CONFIG_ARCH_S390X) > + /* See the comments about the access registers in > + supply_gregset, above. */ > + unsigned int *acrs = (unsigned int *) &gregp[S390_FIRST_ACR]; > + > + regcache_collect (regno, &acrs[regno - S390_FIRST_ACR]); > + #else > + regcache_collect (regno, &gregp[regno]); > + #endif > + } > } > > /* Given a pointer to a floating point register set in /proc format