Convert ADDR_BITS_REMOVE to a function.
+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,
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)
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
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
#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)
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.
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.
}
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)
#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,
}
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
int
saved_pc_after_call ()
{
- return addr_bits_remove
+ return ADDR_BITS_REMOVE
(read_memory_integer (read_register (SP_REGNUM), PTR_SIZE));
}