This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] mips, gdbarch TARGET_READ_SP


Gdbarch-ify another macro.
2002-08-15  Michael Snyder  <msnyder@redhat.com>

	* mips-tdep.c (mips_gdbarch_init): Set gdbarch read_sp to 
	mips_read_sp.
	* config/mips/tm-mips.h (TARGET_READ_SP): Delete.

Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.102
diff -p -r1.102 mips-tdep.c
*** mips-tdep.c	16 Aug 2002 01:23:16 -0000	1.102
--- mips-tdep.c	16 Aug 2002 02:25:26 -0000
*************** mips_register_virtual_type (int reg)
*** 513,518 ****
--- 513,526 ----
      }
  }
  
+ /* TARGET_READ_SP -- Remove useless bits from the stack pointer.  */
+ 
+ static CORE_ADDR
+ mips_read_sp (void)
+ {
+   return ADDR_BITS_REMOVE (read_register (SP_REGNUM));
+ }
+ 
  /* Should the upper word of 64-bit addresses be zeroed? */
  enum auto_boolean mask_address_var = AUTO_BOOLEAN_AUTO;
  
*************** mips_gdbarch_init (struct gdbarch_info i
*** 5170,5176 ****
    set_gdbarch_read_pc (gdbarch, mips_read_pc);
    set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
    set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
!   set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
    set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
  
    /* Add/remove bits from an address. The MIPS needs be careful to
--- 5178,5184 ----
    set_gdbarch_read_pc (gdbarch, mips_read_pc);
    set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
    set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
!   set_gdbarch_read_sp (gdbarch, mips_read_sp);
    set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
  
    /* Add/remove bits from an address. The MIPS needs be careful to
Index: config/mips/tm-mips.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-mips.h,v
retrieving revision 1.32
diff -p -r1.32 tm-mips.h
*** config/mips/tm-mips.h	16 Aug 2002 01:23:17 -0000	1.32
--- config/mips/tm-mips.h	16 Aug 2002 02:25:26 -0000
*************** struct value;
*** 51,60 ****
  
  #define DEFAULT_MIPS_TYPE "generic"
  
- /* Remove useless bits from the stack pointer.  */
- 
- #define TARGET_READ_SP() ADDR_BITS_REMOVE (read_register (SP_REGNUM))
- 
  /* Offset from address of function to start of its code.
     Zero on most machines.  */
  
--- 51,56 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]