Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: deuling@de.ibm.com (Markus Deuling)
Cc: gdb-patches@sourceware.org (GDB Patches)
Subject: Re: [rfc] Remove macros  {SP,PC,PS,FP0}_REGNUM from gdbarch.sh
Date: Mon, 18 Jun 2007 17:48:00 -0000	[thread overview]
Message-ID: <200706181748.l5IHmaZN018535@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <467629FA.7030204@de.ibm.com> from "Markus Deuling" at Jun 18, 2007 08:45:14 AM

Markus Deuling wrote:

> there were lots of changes to various parts of GDB so it was necessary to rebase the REGNUM patch. So here it
> is again. Build and tested on x86. Build with gdb_mbuild.sh

Thanks for re-doing that patch.  It looks like a small number of
places were overlooked; I've now committed this patch together with
those (see patch below).

Longer-term, most uses of those gdbarch callbacks -in particular 
those in platform-specific code- are probably bogus and should be
removed.  But that's a different issue ...

Bye,
Ulrich


diff -urNp gdb-orig/gdb/core-regset.c gdb-head/gdb/core-regset.c
--- gdb-orig/gdb/core-regset.c	2007-06-18 19:36:30.333801855 +0200
+++ gdb-head/gdb/core-regset.c	2007-06-18 19:33:09.217153836 +0200
@@ -85,7 +85,7 @@ fetch_core_registers (struct regcache *r
       else
 	{
 	  memcpy (&fpregset, core_reg_sect, sizeof (fpregset));
-	  if (FP0_REGNUM >= 0)
+	  if (gdbarch_fp0_regnum (current_gdbarch) >= 0)
 	    supply_fpregset (regcache, (const gdb_fpregset_t *) &fpregset);
 	}
       break;
diff -urNp gdb-orig/gdb/i386v4-nat.c gdb-head/gdb/i386v4-nat.c
--- gdb-orig/gdb/i386v4-nat.c	2007-06-18 19:36:30.475781429 +0200
+++ gdb-head/gdb/i386v4-nat.c	2007-06-18 19:32:49.853013932 +0200
@@ -139,7 +139,7 @@ fill_gregset (const struct regcache *reg
 void
 supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
 {
-  if (FP0_REGNUM == 0)
+  if (gdbarch_fp0_regnum (current_gdbarch) == 0)
     return;
 
   i387_supply_fsave (regcache, -1, fpregsetp);
@@ -153,7 +153,7 @@ void
 fill_fpregset (const struct regcache *regcache,
 	       fpregset_t *fpregsetp, int regno)
 {
-  if (FP0_REGNUM == 0)
+  if (gdbarch_fp0_regnum (current_gdbarch) == 0)
     return;
 
   i387_collect_fsave (regcache, regno, fpregsetp);
diff -urNp gdb-orig/gdb/libunwind-frame.c gdb-head/gdb/libunwind-frame.c
--- gdb-orig/gdb/libunwind-frame.c	2007-06-18 19:36:30.505777114 +0200
+++ gdb-head/gdb/libunwind-frame.c	2007-06-18 19:31:19.648301803 +0200
@@ -179,7 +179,7 @@ libunwind_frame_cache (struct frame_info
     }
 
   /* To get base address, get sp from previous frame.  */
-  uw_sp_regnum = descr->gdb2uw (SP_REGNUM);
+  uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (current_gdbarch));
   ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &fp);
   if (ret < 0)
     {
diff -urNp gdb-orig/gdb/mips-linux-tdep.c gdb-head/gdb/mips-linux-tdep.c
--- gdb-orig/gdb/mips-linux-tdep.c	2007-06-18 19:36:35.255759461 +0200
+++ gdb-head/gdb/mips-linux-tdep.c	2007-06-18 19:32:08.925656282 +0200
@@ -1067,7 +1067,8 @@ mips_linux_n32n64_sigframe_init (const s
 static void
 mips_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
 {
-  regcache_cooked_write_unsigned (regcache, PC_REGNUM, pc);
+  regcache_cooked_write_unsigned (regcache,
+				  gdbarch_pc_regnum (current_gdbarch), pc);
 
   /* Clear the syscall restart flag.  */
   if (mips_linux_restart_reg_p (current_gdbarch))


-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2007-06-18 17:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-18  6:47 Markus Deuling
2007-06-18 17:48 ` Ulrich Weigand [this message]
2007-06-19  3:27   ` Markus Deuling
  -- strict thread matches above, loose matches on Subject: below --
2007-06-13 13:19 Markus Deuling
2007-06-13 17:32 ` Eli Zaretskii
2007-06-13 17:39   ` Daniel Jacobowitz
2007-06-13 17:55     ` Eli Zaretskii
2007-06-13 17:49   ` Markus Deuling
2007-06-13 17:57     ` Eli Zaretskii

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=200706181748.l5IHmaZN018535@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=deuling@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /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