This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] [09/14] Prepare sh targets
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 1 May 2007 03:29:26 +0200 (CEST)
- Subject: [rfc] [09/14] Prepare sh targets
Hello,
this patch prepares the sh targets by adding REGCACHE arguments to
internal helper routines.
Bye,
Ulrich
ChangeLog:
* shnbsd-tdep.c (shnbsd_supply_reg): Add REGCACHE parameter, use it
instead of current_regcache. Make REGS const.
(shnbsd_fill_reg): Add REGCACHE parameter; replace current_regcache.
* shnbsd-tdep.h (shnbsd_supply_reg, shnbsd_fill_reg): Update
prototypes.
* shnbsd-nat.c: Include "regcache.h".
(shnbsd_fetch_inferior_registers): Pass current_regcache to
shnbsd_supply_reg.
(shnbsd_store_inferior_registers): Pass current_regcache to
shnbsd_fill_reg.
* Makefile.in (shbsd-nat.o): Update dependencies.
diff -urNp gdb-orig/gdb/Makefile.in gdb-head/gdb/Makefile.in
--- gdb-orig/gdb/Makefile.in 2007-04-28 00:14:52.057802254 +0200
+++ gdb-head/gdb/Makefile.in 2007-04-28 03:03:17.826267334 +0200
@@ -2553,7 +2553,7 @@ sh64-tdep.o: sh64-tdep.c $(defs_h) $(fra
$(gdb_string_h) $(gdb_assert_h) $(arch_utils_h) $(regcache_h) \
$(osabi_h) $(elf_bfd_h) $(elf_sh_h) $(gdb_sim_sh_h)
shnbsd-nat.o: shnbsd-nat.c $(defs_h) $(inferior_h) $(sh_tdep_h) \
- $(shnbsd_tdep_h) $(inf_ptrace_h)
+ $(shnbsd_tdep_h) $(inf_ptrace_h) $(regcache_h)
shnbsd-tdep.o: shnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) $(regset_h) \
$(value_h) $(osabi_h) $(gdb_assert_h) $(gdb_string_h) $(sh_tdep_h) \
$(shnbsd_tdep_h) $(solib_svr4_h)
diff -urNp gdb-orig/gdb/shnbsd-nat.c gdb-head/gdb/shnbsd-nat.c
--- gdb-orig/gdb/shnbsd-nat.c 2007-01-11 20:57:58.000000000 +0100
+++ gdb-head/gdb/shnbsd-nat.c 2007-04-28 03:03:01.104110231 +0200
@@ -31,6 +31,8 @@
#include "sh-tdep.h"
#include "shnbsd-tdep.h"
#include "inf-ptrace.h"
+#include "regcache.h"
+
/* Determine if PT_GETREGS fetches this register. */
#define GETREGS_SUPPLIES(regno) \
@@ -50,7 +52,7 @@ shnbsd_fetch_inferior_registers (int reg
(PTRACE_TYPE_ARG3) &inferior_registers, 0) == -1)
perror_with_name (_("Couldn't get registers"));
- shnbsd_supply_reg ((char *) &inferior_registers, regno);
+ shnbsd_supply_reg (current_regcache, (char *) &inferior_registers, regno);
if (regno != -1)
return;
@@ -68,7 +70,7 @@ shnbsd_store_inferior_registers (int reg
(PTRACE_TYPE_ARG3) &inferior_registers, 0) == -1)
perror_with_name (_("Couldn't get registers"));
- shnbsd_fill_reg ((char *) &inferior_registers, regno);
+ shnbsd_fill_reg (current_regcache, (char *) &inferior_registers, regno);
if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
(PTRACE_TYPE_ARG3) &inferior_registers, 0) == -1)
diff -urNp gdb-orig/gdb/shnbsd-tdep.c gdb-head/gdb/shnbsd-tdep.c
--- gdb-orig/gdb/shnbsd-tdep.c 2007-03-07 19:44:10.000000000 +0100
+++ gdb-head/gdb/shnbsd-tdep.c 2007-04-28 03:02:09.607693371 +0200
@@ -156,16 +156,16 @@ shnbsd_regset_from_core_section (struct
}
void
-shnbsd_supply_reg (char *regs, int regnum)
+shnbsd_supply_reg (struct regcache *regcache, const char *regs, int regnum)
{
- shnbsd_supply_gregset (&shnbsd_gregset, current_regcache, regnum,
+ shnbsd_supply_gregset (&shnbsd_gregset, regcache, regnum,
regs, SHNBSD_SIZEOF_GREGS);
}
void
-shnbsd_fill_reg (char *regs, int regnum)
+shnbsd_fill_reg (const struct regcache *regcache, char *regs, int regnum)
{
- shnbsd_collect_gregset (&shnbsd_gregset, current_regcache, regnum,
+ shnbsd_collect_gregset (&shnbsd_gregset, regcache, regnum,
regs, SHNBSD_SIZEOF_GREGS);
}
diff -urNp gdb-orig/gdb/shnbsd-tdep.h gdb-head/gdb/shnbsd-tdep.h
--- gdb-orig/gdb/shnbsd-tdep.h 2007-01-11 20:57:59.000000000 +0100
+++ gdb-head/gdb/shnbsd-tdep.h 2007-04-28 03:01:20.176117851 +0200
@@ -22,7 +22,7 @@
#ifndef SH_NBSD_TDEP_H
#define SH_NBSD_TDEP_H
-void shnbsd_supply_reg (char *, int);
-void shnbsd_fill_reg (char *, int);
+void shnbsd_supply_reg (struct regcache *, const char *, int);
+void shnbsd_fill_reg (const struct regcache *, char *, int);
#endif /* SH_NBSD_TDEP_H */
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com