aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1998-11-29 07:41:36 +0000
committerAndrew Cagney <cagney@redhat.com>1998-11-29 07:41:36 +0000
commit8743fc885f33a57c09d1822b6fd5d6f6cc99ec9b (patch)
treed2a66b076f54b73533ad7a7241e9cb27489406cf
parent3a0c96a9966a85f4205558490e1281471c34980f (diff)
downloadgdb-8743fc885f33a57c09d1822b6fd5d6f6cc99ec9b.zip
gdb-8743fc885f33a57c09d1822b6fd5d6f6cc99ec9b.tar.gz
gdb-8743fc885f33a57c09d1822b6fd5d6f6cc99ec9b.tar.bz2
CARP:
Convert ADDR_BITS_REMOVE to a function.
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/config/h8500/tm-h8500.h3
-rw-r--r--gdb/config/m88k/tm-m88k.h3
-rw-r--r--gdb/config/w65/tm-w65.h3
-rw-r--r--gdb/config/z8k/tm-z8k.h3
-rw-r--r--gdb/h8500-tdep.c7
-rw-r--r--gdb/m88k-tdep.c15
-rw-r--r--gdb/w65-tdep.c6
-rw-r--r--gdb/z8k-tdep.c9
9 files changed, 49 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 289eb6e..155ce62 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+Sun Nov 29 11:18:37 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * z8k-tdep.c (z8k_addr_bits_remove), w65-tdep.c
+ (w65_addr_bits_remove), h8500-tdep.c (h8500_addr_bits_remove),
+ m88k-tdep.c (m88k_addr_bits_remove): Function to clean up an
+ address.
+ * config/z8k/tm-z8k.h, config/w65/tm-w65.h, config/m88k/tm-m88k.h,
+ config/h8500/tm-h8500.h: Define ADDR_BITS_REMOVE to call targets
+ corresponding function.
+ * z8k-tdep.c (saved_pc_after_call): Update.
+
Sat Nov 28 12:24:31 1998 Andrew Cagney <cagney@b1.cygnus.com>
* config/z8k/tm-z8k.h, config/w65/tm-w65.h, config/vax/tm-vax.h,
diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h
index 22e5061..8f7d966 100644
--- a/gdb/config/h8500/tm-h8500.h
+++ b/gdb/config/h8500/tm-h8500.h
@@ -251,7 +251,8 @@ extern void h8500_pop_frame PARAMS ((void));
typedef unsigned short INSN_WORD;
-#define ADDR_BITS_REMOVE(addr) ((addr) & 0xffffff)
+extern CORE_ADDR h8500_addr_bits_remove PARAMS ((CORE_ADDR));
+#define ADDR_BITS_REMOVE(addr) h8500_addr_bits_remove (addr)
#define read_memory_short(x) (read_memory_integer(x,2) & 0xffff)
diff --git a/gdb/config/m88k/tm-m88k.h b/gdb/config/m88k/tm-m88k.h
index f5c6dc5..390cdef 100644
--- a/gdb/config/m88k/tm-m88k.h
+++ b/gdb/config/m88k/tm-m88k.h
@@ -63,7 +63,8 @@ extern CORE_ADDR skip_prologue ();
to realize that those two bits are not really a part of the address
of an instruction. Shrug. */
-#define ADDR_BITS_REMOVE(addr) ((addr) & ~3)
+extern CORE_ADDR m88k_addr_bits_remove PARAMS ((CORE_ADDR));
+#define ADDR_BITS_REMOVE(addr) m88k_addr_bits_remove (addr)
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
diff --git a/gdb/config/w65/tm-w65.h b/gdb/config/w65/tm-w65.h
index 6809f93..2e354bb 100644
--- a/gdb/config/w65/tm-w65.h
+++ b/gdb/config/w65/tm-w65.h
@@ -191,7 +191,8 @@ extern CORE_ADDR w65_skip_prologue ();
typedef unsigned short INSN_WORD;
-#define ADDR_BITS_REMOVE(addr) ((addr) & 0xffffff)
+extern CORE_ADDR w65_addr_bits_remove PARAMS ((CORE_ADDR));
+#define ADDR_BITS_REMOVE(addr) w65_addr_bits_remove (addr)
#define CALL_DUMMY_LENGTH 10
diff --git a/gdb/config/z8k/tm-z8k.h b/gdb/config/z8k/tm-z8k.h
index 8800a9c..8ec1356 100644
--- a/gdb/config/z8k/tm-z8k.h
+++ b/gdb/config/z8k/tm-z8k.h
@@ -263,7 +263,8 @@ extern void z8k_pop_frame PARAMS ((void));
#define SP_ARG0 (1 * 4)
-#define ADDR_BITS_REMOVE(x) addr_bits_remove(x)
+extern CORE_ADDR z8k_addr_bits_remove PARAMS ((CORE_ADDR));
+#define ADDR_BITS_REMOVE(addr) z8k_addr_bits_remove (addr)
int sim_z8001_mode;
#define BIG (sim_z8001_mode)
diff --git a/gdb/h8500-tdep.c b/gdb/h8500-tdep.c
index e66bcc3..49fab2d 100644
--- a/gdb/h8500-tdep.c
+++ b/gdb/h8500-tdep.c
@@ -98,6 +98,13 @@ h8500_skip_prologue (start_pc)
return start_pc;
}
+CORE_ADDR
+h8500_addr_bits_remove (addr)
+ CORE_ADDR addr;
+{
+ return ((addr) & 0xffffff);
+}
+
/* Given a GDB frame, determine the address of the calling function's frame.
This will be used to create a new GDB frame struct, and then
INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame.
diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c
index f74560e..7a75508 100644
--- a/gdb/m88k-tdep.c
+++ b/gdb/m88k-tdep.c
@@ -36,6 +36,21 @@ void frame_find_saved_regs ();
int target_is_m88110 = 0;
+/* The m88k kernel aligns all instructions on 4-byte boundaries. The
+ kernel also uses the least significant two bits for its own hocus
+ pocus. When gdb receives an address from the kernel, it needs to
+ preserve those right-most two bits, but gdb also needs to be careful
+ to realize that those two bits are not really a part of the address
+ of an instruction. Shrug. */
+
+CORE_ADDR
+m88k_addr_bits_remove (addr)
+ CORE_ADDR addr;
+{
+ return ((addr) & ~3);
+}
+
+
/* Given a GDB frame, determine the address of the calling function's frame.
This will be used to create a new GDB frame struct, and then
INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame.
diff --git a/gdb/w65-tdep.c b/gdb/w65-tdep.c
index e099f71..9546616 100644
--- a/gdb/w65-tdep.c
+++ b/gdb/w65-tdep.c
@@ -42,10 +42,10 @@ w65_frame_saved_pc (frame)
}
CORE_ADDR
-addr_bits_remove (x)
- CORE_ADDR x;
+w65_addr_bits_remove (addr)
+ CORE_ADDR addr;
{
- return x;
+ return ((addr) & 0xffffff);
}
read_memory_pointer (x)
diff --git a/gdb/z8k-tdep.c b/gdb/z8k-tdep.c
index 5696056..29e9f6b 100644
--- a/gdb/z8k-tdep.c
+++ b/gdb/z8k-tdep.c
@@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "dis-asm.h"
#include "gdbcore.h"
+
/* Return the saved PC from this frame.
If the frame has a memory copy of SRP_REGNUM, use that. If not,
@@ -143,10 +144,10 @@ z8k_skip_prologue (start_pc)
}
CORE_ADDR
-addr_bits_remove (x)
- CORE_ADDR x;
+z8k_addr_bits_remove (addr)
+ CORE_ADDR addr;
{
- return x & PTR_MASK;
+ return (addr & PTR_MASK);
}
int
@@ -293,7 +294,7 @@ frame_find_saved_regs (fip, fsrp)
int
saved_pc_after_call ()
{
- return addr_bits_remove
+ return ADDR_BITS_REMOVE
(read_memory_integer (read_register (SP_REGNUM), PTR_SIZE));
}