Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@specifix.com>
To: gdb-patches@sourceware.org
Cc: uweigand@de.ibm.com, dueling@de.ibm.com
Subject: [RFA] NetBSD, mipsnbsd-tdep.c supply_gregset 32/64
Date: Fri, 14 Dec 2007 00:29:00 -0000	[thread overview]
Message-ID: <1197591969.20496.13.camel@localhost.localdomain> (raw)

Similar to yesterday's patch, this one accounts for core files.

2007-12-13  Michael Snyder  <msnyder@specifix.com>

	* 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);
     }
 }



                 reply	other threads:[~2007-12-14  0:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1197591969.20496.13.camel@localhost.localdomain \
    --to=msnyder@specifix.com \
    --cc=dueling@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox