]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
CARP:
authorAndrew Cagney <cagney@redhat.com>
Sun, 29 Nov 1998 07:41:36 +0000 (07:41 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sun, 29 Nov 1998 07:41:36 +0000 (07:41 +0000)
Convert ADDR_BITS_REMOVE to a function.

gdb/ChangeLog
gdb/config/h8500/tm-h8500.h
gdb/config/m88k/tm-m88k.h
gdb/config/w65/tm-w65.h
gdb/config/z8k/tm-z8k.h
gdb/h8500-tdep.c
gdb/m88k-tdep.c
gdb/w65-tdep.c
gdb/z8k-tdep.c

index 289eb6ec0b15e96773ed3d75fc320cde5c9fe19e..155ce629201eb17b5d212c9c0f94c32aaa3c550e 100644 (file)
@@ -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,
index 22e5061b7621c0d878962bc259e37d3e0fa20d07..8f7d9664efdad92ab41835bcfcb58b6a71981b3c 100644 (file)
@@ -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)
 
index f5c6dc502fd8ce57f81efef200155e625a366c76..390cdef96eafc649e3a74f5b7ab517b9c48c30e0 100644 (file)
@@ -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
index 6809f931ed7837d053d0d67abf96031901ae6ab5..2e354bbb18fa584807586f19616003e652b69338 100644 (file)
@@ -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
 
index 8800a9ceaba85485ed72891690ede8738853a03f..8ec1356b1a9fabbd633fbdc699603a4ffcd88e5a 100644 (file)
@@ -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)
 
index e66bcc3dbf696571c8e322d1259872f2d7dfb77d..49fab2d54e560ef07dc0ed33a485448c7a49f564 100644 (file)
@@ -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.
index f74560e1d834fbe7e29d2c40c4aa2524b0f265c4..7a755082a6d3d1464796fc8a452e6d7397f1363f 100644 (file)
@@ -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.
index e099f71e65a50b1e3912164e26783b0c5746f4e6..9546616af4e922968baac41fd1fc070272cd8e67 100644 (file)
@@ -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)
index 569605606abf3576fb41e3e3fa0d8194e0809a06..29e9f6bafa3cbf5f178d211ed82cb980b49da381 100644 (file)
@@ -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));
 }