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 move arm to GDB_MULTI_ARCH_PARTIAL


The ARM targets are now running at GDB_MULTI_ARCH_PARTIAL....

2002-02-08  Richard Earnshaw  <rearnsha@arm.com>

	* arm-tdep.c (arm_frame_chain_valid): Make static.
	(arm_push_arguments): Likewise.
	(arm_gdbarch_init): New function.
	(_initialize_arm_tdep): Call it.
	* config/arm/tm-arm.h (GDB_MULTI_ARCH): Set to 1.
	(TARGET_DOUBLE_FORMAT): Test TARGET_BYTE_ORDER, not target_byte_order.
	(FRAME_CHAIN_VALID): Delete.
	(arm_frame_chain_valid): Delete declaration.
	(PUSH_ARGUMENTS): Delete.
	(arm_push_arguments): Delete declaration.
	(CALL_DUMMY_P): Delete.


Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.36
diff -p -r1.36 arm-tdep.c
*** arm-tdep.c	2002/02/06 15:21:16	1.36
--- arm-tdep.c	2002/02/08 18:21:04
*************** arm_use_struct_convention (int gcc_p, st
*** 235,241 ****
    return nRc;
  }
  
! int
  arm_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
  {
    return (chain != 0 && (FRAME_SAVED_PC (thisframe) >= LOWEST_PC));
--- 235,241 ----
    return nRc;
  }
  
! static int
  arm_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
  {
    return (chain != 0 && (FRAME_SAVED_PC (thisframe) >= LOWEST_PC));
*************** arm_call_dummy_breakpoint_offset (void)
*** 1417,1423 ****
     variant of the APCS.  It passes any floating point arguments in the
     general registers and/or on the stack.  */
  
! CORE_ADDR
  arm_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
  		    int struct_return, CORE_ADDR struct_addr)
  {
--- 1417,1423 ----
     variant of the APCS.  It passes any floating point arguments in the
     general registers and/or on the stack.  */
  
! static CORE_ADDR
  arm_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
  		    int struct_return, CORE_ADDR struct_addr)
  {
*************** arm_coff_make_msymbol_special(int val, s
*** 2341,2346 ****
--- 2341,2375 ----
      MSYMBOL_SET_SPECIAL (msym);
  }
  
+ static struct gdbarch *
+ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ {
+   struct gdbarch *gdbarch;
+ 
+   if (arches != NULL)
+     return arches->gdbarch;
+ 
+   /* XXX We'll probably need to set the tdep field soon.  */
+   gdbarch = gdbarch_alloc (&info, NULL);
+ 
+   set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
+ 
+   /* Call dummy code.  */
+   set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+   set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
+   set_gdbarch_call_dummy_p (gdbarch, 1);
+   set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
+ 
+   set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack);
+ 
+   set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
+   set_gdbarch_push_arguments (gdbarch, arm_push_arguments);
+ 
+   set_gdbarch_frame_chain_valid (gdbarch, arm_frame_chain_valid);
+ 
+   return gdbarch;
+ }
+ 
  void
  _initialize_arm_tdep (void)
  {
*************** _initialize_arm_tdep (void)
*** 2352,2357 ****
--- 2381,2389 ----
    const char **regnames;
    int numregs, i, j;
    static char *helptext;
+ 
+   if (GDB_MULTI_ARCH)
+     register_gdbarch_init (bfd_arch_arm, arm_gdbarch_init);
  
    tm_print_insn = gdb_print_insn_arm;
  
Index: config/arm/tm-arm.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-arm.h,v
retrieving revision 1.23
diff -p -r1.23 tm-arm.h
*** tm-arm.h	2002/02/06 15:21:17	1.23
--- tm-arm.h	2002/02/08 18:21:05
***************
*** 22,27 ****
--- 22,31 ----
  #ifndef TM_ARM_H
  #define TM_ARM_H
  
+ #ifndef GDB_MULTI_ARCH
+ #define GDB_MULTI_ARCH 1
+ #endif
+ 
  #include "regcache.h"
  #include "floatformat.h"
  
*************** struct type;
*** 30,36 ****
  struct value;
  
  /* IEEE format floating point.  */
! #define TARGET_DOUBLE_FORMAT  (target_byte_order == BFD_ENDIAN_BIG \
  			       ? &floatformat_ieee_double_big	 \
  			       : &floatformat_ieee_double_littlebyte_bigword)
  
--- 34,40 ----
  struct value;
  
  /* IEEE format floating point.  */
! #define TARGET_DOUBLE_FORMAT  (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG \
  			       ? &floatformat_ieee_double_big	 \
  			       : &floatformat_ieee_double_littlebyte_bigword)
  
*************** CORE_ADDR arm_target_read_fp (void);
*** 324,333 ****
  CORE_ADDR arm_frame_chain (struct frame_info *);
  #define FRAME_CHAIN(thisframe) arm_frame_chain (thisframe)
  
- int arm_frame_chain_valid (CORE_ADDR, struct frame_info *);
- #define FRAME_CHAIN_VALID(chain, thisframe) \
-      arm_frame_chain_valid (chain, thisframe)
- 
  /* Define other aspects of the stack frame.  */
  
  int arm_frameless_function_invocation (struct frame_info *fi);
--- 328,333 ----
*************** void arm_frame_init_saved_regs (struct f
*** 359,370 ****
  #define FRAME_INIT_SAVED_REGS(frame_info) \
  	arm_frame_init_saved_regs (frame_info);
  
- /* Things needed for making the inferior call functions.  */
- 
- CORE_ADDR arm_push_arguments (int, struct value **, CORE_ADDR, int, CORE_ADDR);
- #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
-      arm_push_arguments ((nargs), (args), (sp), (struct_return), (struct_addr))
- 
  /* Push an empty stack frame, to record the current PC, etc.  */
  
  void arm_push_dummy_frame (void);
--- 359,364 ----
*************** void arm_push_dummy_frame (void);
*** 376,383 ****
  void arm_pop_frame (void);
  
  #define POP_FRAME arm_pop_frame ()
- 
- #define CALL_DUMMY_P (1)
  
  #define CALL_DUMMY_WORDS arm_call_dummy_words
  extern LONGEST arm_call_dummy_words[];
--- 370,375 ----

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