aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-05-13 17:20:59 +0000
committerAndrew Cagney <cagney@redhat.com>2002-05-13 17:20:59 +0000
commit6d53172289ad02b0ca255c6b85d79c2d9be43b4f (patch)
tree3115496f6d9f23d2db92f8cd892dd01fd8ffecbc /gdb
parent3e3f273960b18167f33f032d88605deabbc5e436 (diff)
downloadgdb-6d53172289ad02b0ca255c6b85d79c2d9be43b4f.zip
gdb-6d53172289ad02b0ca255c6b85d79c2d9be43b4f.tar.gz
gdb-6d53172289ad02b0ca255c6b85d79c2d9be43b4f.tar.bz2
* config/m88k/tm-m88k.h: Update copyright.
(m88k_target_write_pc): Declare (TARGET_WRITE_PC): Redefine using m88k_target_write_pc. (M88K_NNPC_REGNUM): Rename NNPC_REGNUM. (SHIFT_INST_REGS): Update definition. * m88k-tdep.c (m88k_target_write_pc): New function. Implement using old definition of TARGET_WRITE_PC. * regcache.c (generic_target_write_pc): Delete code handling NNPC_REGNUM. * gdbarch.sh (NNPC_REGNUM): Delete. * gdbarch.h, gdbarch.c: Regenerate. * gdbint.texinfo (Target Architecture Definition): Delete documentation on NNPC_REGNUM.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog14
-rw-r--r--gdb/config/m88k/tm-m88k.h18
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/doc/gdbint.texinfo5
-rw-r--r--gdb/gdbarch.c29
-rw-r--r--gdb/gdbarch.h16
-rwxr-xr-xgdb/gdbarch.sh1
-rw-r--r--gdb/m88k-tdep.c31
-rw-r--r--gdb/regcache.c2
9 files changed, 56 insertions, 65 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1b2ad40..79d5dd6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,17 @@
+2002-05-13 Andrew Cagney <ac131313@redhat.com>
+
+ * config/m88k/tm-m88k.h: Update copyright.
+ (m88k_target_write_pc): Declare
+ (TARGET_WRITE_PC): Redefine using m88k_target_write_pc.
+ (M88K_NNPC_REGNUM): Rename NNPC_REGNUM.
+ (SHIFT_INST_REGS): Update definition.
+ * m88k-tdep.c (m88k_target_write_pc): New function. Implement
+ using old definition of TARGET_WRITE_PC.
+ * regcache.c (generic_target_write_pc): Delete code handling
+ NNPC_REGNUM.
+ * gdbarch.sh (NNPC_REGNUM): Delete.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
2002-05-13 Richard Earnshaw <rearnsha@arm.com>
* builtin-regs.c (value_of_builtin_reg): Correctly calculate the
diff --git a/gdb/config/m88k/tm-m88k.h b/gdb/config/m88k/tm-m88k.h
index 4df0822..7405c12 100644
--- a/gdb/config/m88k/tm-m88k.h
+++ b/gdb/config/m88k/tm-m88k.h
@@ -1,7 +1,7 @@
/* Target machine description for generic Motorola 88000, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994, 1996, 1998,
- 1999, 2000
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994, 1996,
+ 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -266,7 +266,8 @@ extern CORE_ADDR m88k_addr_bits_remove (CORE_ADDR);
#define PC_REGNUM SXIP_REGNUM /* Program Counter */
#define NPC_REGNUM SNIP_REGNUM /* Next Program Counter */
-#define NNPC_REGNUM SFIP_REGNUM /* Next Next Program Counter */
+#define M88K_NNPC_REGNUM SFIP_REGNUM /* Next Next Program Counter */
+
#define PSR_REGNUM 32 /* Processor Status Register */
#define FPSR_REGNUM 33 /* Floating Point Status Register */
@@ -330,7 +331,7 @@ if (!target_is_m88110) \
CORE_ADDR npc = read_register (NPC_REGNUM); \
if (pc != npc) \
{ \
- write_register (NNPC_REGNUM, npc); \
+ write_register (M88K_NNPC_REGNUM, npc); \
write_register (NPC_REGNUM, pc); \
} \
}
@@ -582,8 +583,5 @@ extern void m88k_push_dummy_frame ();
-- Kevin Buettner
*/
-#define TARGET_WRITE_PC(val, pid) { \
- write_register_pid(SXIP_REGNUM, (long) val, pid); \
- write_register_pid(SNIP_REGNUM, (long) val | 2, pid); \
- write_register_pid(SFIP_REGNUM, ((long) val | 2) + 4, pid); \
-}
+extern void m88k_target_write_pc (CORE_ADDR pc, ptid_t ptid);
+#define TARGET_WRITE_PC(VAL, PID) m88k_target_write_pc (VAL, PID)
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 3212800..83a87fa 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-13 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Delete
+ documentation on NNPC_REGNUM.
+
2002-05-11 Andrew Cagney <ac131313@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Document
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index f371659..55442d4 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -3417,11 +3417,6 @@ This should only need to be defined if @code{TARGET_READ_PC} and
@findex NPC_REGNUM
The number of the ``next program counter'' register, if defined.
-@item NNPC_REGNUM
-@findex NNPC_REGNUM
-The number of the ``next next program counter'' register, if defined.
-Currently, this is only defined for the Motorola 88K.
-
@item PARM_BOUNDARY
@findex PARM_BOUNDARY
If non-zero, round arguments to a boundary of this many bits before
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 52cc959..6990953 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -155,7 +155,6 @@ struct gdbarch
int ps_regnum;
int fp0_regnum;
int npc_regnum;
- int nnpc_regnum;
gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
@@ -314,7 +313,6 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
- 0,
generic_register_size,
0,
generic_register_size,
@@ -476,7 +474,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->ps_regnum = -1;
current_gdbarch->fp0_regnum = -1;
current_gdbarch->npc_regnum = -1;
- current_gdbarch->nnpc_regnum = -1;
current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
@@ -610,7 +607,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of ps_regnum, invalid_p == 0 */
/* Skip verify of fp0_regnum, invalid_p == 0 */
/* Skip verify of npc_regnum, invalid_p == 0 */
- /* Skip verify of nnpc_regnum, invalid_p == 0 */
/* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
/* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
/* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
@@ -1439,14 +1435,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->memory_remove_breakpoint
/*MEMORY_REMOVE_BREAKPOINT ()*/);
#endif
-#ifdef NNPC_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: NNPC_REGNUM # %s\n",
- XSTRING (NNPC_REGNUM));
- fprintf_unfiltered (file,
- "gdbarch_dump: NNPC_REGNUM = %d\n",
- NNPC_REGNUM);
-#endif
#ifdef NPC_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: NPC_REGNUM # %s\n",
@@ -2734,23 +2722,6 @@ set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
}
int
-gdbarch_nnpc_regnum (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- /* Skip verify of nnpc_regnum, invalid_p == 0 */
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n");
- return gdbarch->nnpc_regnum;
-}
-
-void
-set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch,
- int nnpc_regnum)
-{
- gdbarch->nnpc_regnum = nnpc_regnum;
-}
-
-int
gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
{
gdb_assert (gdbarch != NULL);
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 94f12d2..9f45459 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -558,22 +558,6 @@ extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum);
#endif
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (NNPC_REGNUM)
-#define NNPC_REGNUM (-1)
-#endif
-
-extern int gdbarch_nnpc_regnum (struct gdbarch *gdbarch);
-extern void set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, int nnpc_regnum);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NNPC_REGNUM)
-#error "Non multi-arch definition of NNPC_REGNUM"
-#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NNPC_REGNUM)
-#define NNPC_REGNUM (gdbarch_nnpc_regnum (current_gdbarch))
-#endif
-#endif
-
/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
/* Default (function) for non- multi-arch platforms. */
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index dab4aac..ebcb423 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -447,7 +447,6 @@ v:2:PC_REGNUM:int:pc_regnum::::-1:-1::0
v:2:PS_REGNUM:int:ps_regnum::::-1:-1::0
v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0
v:2:NPC_REGNUM:int:npc_regnum::::0:-1::0
-v:2:NNPC_REGNUM:int:nnpc_regnum::::0:-1::0
# Convert stab register number (from \`r\' declaration) to a gdb REGNUM.
f:2:STAB_REG_TO_REGNUM:int:stab_reg_to_regnum:int stab_regnr:stab_regnr:::no_op_reg_to_regnum::0
# Provide a default mapping from a ecoff register number to a gdb REGNUM.
diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c
index 86ca098..3c96d37 100644
--- a/gdb/m88k-tdep.c
+++ b/gdb/m88k-tdep.c
@@ -1,6 +1,7 @@
/* Target-machine dependent code for Motorola 88000 series, for GDB.
- Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000,
- 2001 Free Software Foundation, Inc.
+
+ Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
+ 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -39,6 +40,32 @@ void frame_find_saved_regs ();
int target_is_m88110 = 0;
+void
+m88k_target_write_pc (CORE_ADDR pc, ptid_t ptid)
+{
+ /* According to the MC88100 RISC Microprocessor User's Manual,
+ section 6.4.3.1.2:
+
+ ... can be made to return to a particular instruction by placing
+ a valid instruction address in the SNIP and the next sequential
+ instruction address in the SFIP (with V bits set and E bits
+ clear). The rte resumes execution at the instruction pointed to
+ by the SNIP, then the SFIP.
+
+ The E bit is the least significant bit (bit 0). The V (valid)
+ bit is bit 1. This is why we logical or 2 into the values we are
+ writing below. It turns out that SXIP plays no role when
+ returning from an exception so nothing special has to be done
+ with it. We could even (presumably) give it a totally bogus
+ value.
+
+ -- Kevin Buettner */
+
+ write_register_pid (SXIP_REGNUM, pc, ptid);
+ write_register_pid (SNIP_REGNUM, (pc | 2), ptid);
+ write_register_pid (SFIP_REGNUM, (pc | 2) + 4, ptid);
+}
+
/* The type of a register. */
struct type *
m88k_register_type (int regnum)
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 8c1a0aa..bbad17d 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -654,8 +654,6 @@ generic_target_write_pc (CORE_ADDR pc, ptid_t ptid)
write_register_pid (PC_REGNUM, pc, ptid);
if (NPC_REGNUM >= 0)
write_register_pid (NPC_REGNUM, pc + 4, ptid);
- if (NNPC_REGNUM >= 0)
- write_register_pid (NNPC_REGNUM, pc + 8, ptid);
#else
internal_error (__FILE__, __LINE__,
"generic_target_write_pc");