From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29284 invoked by alias); 14 Dec 2007 00:26:18 -0000 Received: (qmail 29274 invoked by uid 22791); 14 Dec 2007 00:26:17 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Dec 2007 00:26:13 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 30B0A3C0FC; Thu, 13 Dec 2007 16:26:10 -0800 (PST) Subject: [RFA] NetBSD, mipsnbsd-tdep.c supply_gregset 32/64 From: Michael Snyder To: gdb-patches@sourceware.org Cc: uweigand@de.ibm.com, dueling@de.ibm.com Content-Type: text/plain Date: Fri, 14 Dec 2007 00:29:00 -0000 Message-Id: <1197591969.20496.13.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-4.fc7) Content-Transfer-Encoding: 7bit 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: 2007-12/txt/msg00181.txt.bz2 Similar to yesterday's patch, this one accounts for core files. 2007-12-13 Michael Snyder * mipsnbsd-tdep.c (mipsnbsd_supply_gregset): Convert 32/64 bits, for targets in which mips_abi_size != mips_isa_size. Index: mipsnbsd-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mipsnbsd-tdep.c,v retrieving revision 1.32 diff -u -p -r1.32 mipsnbsd-tdep.c --- mipsnbsd-tdep.c 16 Nov 2007 04:56:45 -0000 1.32 +++ mipsnbsd-tdep.c 14 Dec 2007 00:22:43 -0000 @@ -81,22 +81,31 @@ mipsnbsd_supply_gregset (const struct re struct regcache *regcache, int regnum, const void *gregs, size_t len) { - size_t regsize = mips_isa_regsize (get_regcache_arch (regcache)); + size_t abisize = mips_abi_regsize (get_regcache_arch (regcache)); const char *regs = gregs; int i; - gdb_assert (len >= MIPSNBSD_NUM_GREGS * regsize); + gdb_assert (len >= MIPSNBSD_NUM_GREGS * abisize); - for (i = 0; i <= MIPS_PC_REGNUM; i++) + for (i = 0; i <= MIPSFBSD_NUM_GREGS; i++) { if (regnum == i || regnum == -1) - regcache_raw_supply (regcache, i, regs + i * regsize); + { + size_t isasize = register_size (current_gdbarch, i); + void *addr = regs + i * abisize; + gdb_byte buf[MAX_REGISTER_SIZE]; + LONGEST val; + + val = extract_signed_integer (addr, abisize); + store_signed_integer (buf, isasize, val); + regcache_raw_supply (regcache, i, buf); + } } - if (len >= (MIPSNBSD_NUM_GREGS + MIPSNBSD_NUM_FPREGS) * regsize) + if (len >= (MIPSNBSD_NUM_GREGS + MIPSNBSD_NUM_FPREGS) * abisize) { - regs += MIPSNBSD_NUM_GREGS * regsize; - len -= MIPSNBSD_NUM_GREGS * regsize; + regs += MIPSNBSD_NUM_GREGS * abisize; + len -= MIPSNBSD_NUM_GREGS * abisize; mipsnbsd_supply_fpregset (regset, regcache, regnum, regs, len); } }