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]

[patch] multi-arch INIT_FRAME_PC*; Was: New gdb 31 & 64 bit patches for S/390


Hello,

I've checked in the attatched, it multi-arches INIT_FRAME_PC_FIRST.  (I 
also got a little carried away and multi-arched INIT_FRAME_PC as well :-)

	Andrew
2001-06-15  Andrew Cagney  <ac131313@redhat.com>

	* gdbarch.sh: Clarify pre/post default
	(INIT_FRAME_PC_FIRST, INIT_FRAME_PC): Multiarch.
	* blockframe.c (get_prev_frame): Remove #ifdef from around
	INIT_FRAME_PC_FIRST call.
	* arch-utils.c (init_frame_pc_noop): Define.
	* arch-utils.h (init_frame_pc_noop): Declare.
	* config/mips/tm-mips.h (INIT_FRAME_PC_FIRST): Delete.
	(INIT_FRAME_PC, mips_init_frame_pc_first): Ditto.
	* mips-tdep.c (mips_init_frame_pc_first): Make static.
	(mips_gdbarch_init): Initialize init_frame_pc_first.
	(mips_dump_tdep): Update.

Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.30
diff -p -r1.30 arch-utils.c
*** arch-utils.c	2001/06/15 22:10:21	1.30
--- arch-utils.c	2001/06/15 23:01:37
*************** generic_prepare_to_proceed (int select_i
*** 300,305 ****
--- 300,311 ----
    
  }
  
+ void
+ init_frame_pc_noop (int fromleaf, struct frame_info *prev)
+ {
+   return;
+ }
+ 
  /* Functions to manipulate the endianness of the target.  */
  
  #ifdef TARGET_BYTE_ORDER_SELECTABLE
Index: arch-utils.h
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.h,v
retrieving revision 1.15
diff -p -r1.15 arch-utils.h
*** arch-utils.h	2001/06/15 22:10:21	1.15
--- arch-utils.h	2001/06/15 23:01:37
*************** extern int default_prepare_to_proceed (i
*** 111,114 ****
--- 111,118 ----
  
  extern int generic_prepare_to_proceed (int select_it);
  
+ /* Version of init_frame_pc() that does nothing. */
+ 
+ void init_frame_pc_noop (int fromleaf, struct frame_info *prev);
+ 
  #endif
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.15
diff -p -r1.15 blockframe.c
*** blockframe.c	2001/05/17 20:04:46	1.15
--- blockframe.c	2001/06/15 23:01:37
*************** get_prev_frame (struct frame_info *next_
*** 442,450 ****
     Some machines won't use it.
     kingdon@cygnus.com, 13Apr93, 31Jan94, 14Dec94.  */
  
- #ifdef INIT_FRAME_PC_FIRST
    INIT_FRAME_PC_FIRST (fromleaf, prev);
- #endif
  
  #ifdef INIT_EXTRA_FRAME_INFO
    INIT_EXTRA_FRAME_INFO (fromleaf, prev);
--- 442,448 ----
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.68
diff -p -r1.68 gdbarch.sh
*** gdbarch.sh	2001/06/15 22:10:21	1.68
--- gdbarch.sh	2001/06/15 23:01:38
*************** do
*** 248,274 ****
  
      predefault ) : ;;
  
! 	# A initial value to assign to MEMBER of the freshly
! 	# malloc()ed gdbarch object.  After the gdbarch object has
! 	# been initialized using PREDEFAULT, it is passed to the
! 	# target code for further updates.
  
  	# If PREDEFAULT is empty, zero is used.
  
! 	# When POSTDEFAULT is empty, a non-empty PREDEFAULT and a zero
! 	# INVALID_P will be used as default values when when
! 	# multi-arch is disabled.  Specify a zero PREDEFAULT function
! 	# to make that fallback call internal_error().
  
  	# Variable declarations can refer to ``gdbarch'' which will
  	# contain the current architecture.  Care should be taken.
  
      postdefault ) : ;;
  
  	# A value to assign to MEMBER of the new gdbarch object should
! 	# the target code fail to change the PREDEFAULT value.  Also
! 	# use POSTDEFAULT as the fallback value for the non-
! 	# multi-arch case.
  
  	# If POSTDEFAULT is empty, no post update is performed.
  
--- 248,275 ----
  
      predefault ) : ;;
  
! 	# An initial value to assign to MEMBER of the freshly
! 	# malloc()ed gdbarch object.  After initialization, the
! 	# freshly malloc()ed object is passed to the target
! 	# architecture code for further updates.
  
  	# If PREDEFAULT is empty, zero is used.
  
! 	# A non-empty PREDEFAULT, an empty POSTDEFAULT and a zero
! 	# INVALID_P are specified, PREDEFAULT will be used as the
! 	# default for the non- multi-arch target.
  
+ 	# A zero PREDEFAULT function will force the fallback to call
+ 	# internal_error().
+ 
  	# Variable declarations can refer to ``gdbarch'' which will
  	# contain the current architecture.  Care should be taken.
  
      postdefault ) : ;;
  
  	# A value to assign to MEMBER of the new gdbarch object should
! 	# the target architecture code fail to change the PREDEFAULT
! 	# value.
  
  	# If POSTDEFAULT is empty, no post update is performed.
  
*************** do
*** 276,281 ****
--- 277,287 ----
  	# INVALID_P will be used to determine if MEMBER should be
  	# changed to POSTDEFAULT.
  
+ 	# If a non-empty POSTDEFAULT and a zero INVALID_P are
+ 	# specified, POSTDEFAULT will be used as the default for the
+ 	# non- multi-arch target (regardless of the value of
+ 	# PREDEFAULT).
+ 
  	# You cannot specify both a zero INVALID_P and a POSTDEFAULT.
  
  	# Variable declarations can refer to ``gdbarch'' which will
*************** v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_c
*** 438,443 ****
--- 444,451 ----
  v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1:::0x%08lx
  v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0:::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P
  f:2:FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p:::0
+ f:2:INIT_FRAME_PC_FIRST:void:init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_noop::0
+ f:2:INIT_FRAME_PC:void:init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_noop::0
  #
  v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
  v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type:::::::
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.52
diff -p -r1.52 mips-tdep.c
*** mips-tdep.c	2001/06/15 22:10:21	1.52
--- mips-tdep.c	2001/06/15 23:01:39
*************** mips_addr_bits_remove (CORE_ADDR addr)
*** 1379,1385 ****
    return addr;
  }
  
! void
  mips_init_frame_pc_first (int fromleaf, struct frame_info *prev)
  {
    CORE_ADDR pc, tmp;
--- 1379,1385 ----
    return addr;
  }
  
! static void
  mips_init_frame_pc_first (int fromleaf, struct frame_info *prev)
  {
    CORE_ADDR pc, tmp;
*************** mips_gdbarch_init (struct gdbarch_info i
*** 4127,4132 ****
--- 4127,4136 ----
       ensure that all 32 bit addresses are sign extended to 64 bits. */
    set_gdbarch_addr_bits_remove (gdbarch, mips_addr_bits_remove);
  
+   /* There's a mess in stack frame creation.  See comments in
+      blockframe.c near reference to INIT_FRAME_PC_FIRST.  */
+   set_gdbarch_init_frame_pc_first (gdbarch, mips_init_frame_pc_first);
+ 
    /* Map debug register numbers onto internal register numbers. */
    set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum);
    set_gdbarch_ecoff_reg_to_regnum (gdbarch, mips_ecoff_reg_to_regnum);
*************** mips_dump_tdep (struct gdbarch *current_
*** 4328,4339 ****
    fprintf_unfiltered (file,
  		      "mips_dump_tdep: IGNORE_HELPER_CALL # %s\n",
  		      XSTRING (IGNORE_HELPER_CALL (PC)));
-   fprintf_unfiltered (file,
- 		      "mips_dump_tdep: INIT_FRAME_PC # %s\n",
- 		      XSTRING (INIT_FRAME_PC (FROMLEAF, PREV)));
-   fprintf_unfiltered (file,
- 		      "mips_dump_tdep: INIT_FRAME_PC_FIRST # %s\n",
- 		      XSTRING (INIT_FRAME_PC_FIRST (FROMLEAF, PREV)));
    fprintf_unfiltered (file,
  		      "mips_dump_tdep: IN_SIGTRAMP # %s\n",
  		      XSTRING (IN_SIGTRAMP (PC, NAME)));
--- 4332,4337 ----
Index: config/mips/tm-mips.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-mips.h,v
retrieving revision 1.19
diff -p -r1.19 tm-mips.h
*** tm-mips.h	2001/06/15 22:10:21	1.19
--- tm-mips.h	2001/06/15 23:01:39
*************** extern void mips_pop_frame (void);
*** 383,397 ****
  #define CALL_DUMMY_ADDRESS() (mips_call_dummy_address ())
  extern CORE_ADDR mips_call_dummy_address (void);
  
- /* There's a mess in stack frame creation.  See comments in blockframe.c
-    near reference to INIT_FRAME_PC_FIRST.  */
- 
- #define	INIT_FRAME_PC(fromleaf, prev)	/* nada */
- 
- #define INIT_FRAME_PC_FIRST(fromleaf, prev) \
-    mips_init_frame_pc_first(fromleaf, prev)
- extern void mips_init_frame_pc_first (int, struct frame_info *);
- 
  /* Special symbol found in blocks associated with routines.  We can hang
     mips_extra_func_info_t's off of this.  */
  
--- 383,388 ----

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