[PATCH]: misc h8300 target cleanup

J.T. Conklin jtc@redback.com
Fri Mar 16 14:27:00 GMT 2001


I'm still cleaning up includes.  It's a little easier to see when I've
biffed something if there are no implicitly defined functions to start
with, so any implicitly defined function warnings that show up after a
include shuffle indicate a problem (in the change, or perhaps in that
target's tm-*.h file).

I am committing the enclosed changes under the "obviously correct rule".

        --jtc

2001-03-16  J.T. Conklin  <jtc@redback.com>

	* config/h8300/tm-h8300.h (FRAME_ARGS_ADDRESS): Changed to use
	h8300_frame_args_address from frame_args_address.
	(FRAME_LOCALS_ADDRESS): Changed to use h8300_frame_locals_address
	from frame_locals_address.
	(PRINT_REGISTER_HOOK): Changed to use h8300_print_register_hook
	from print_register_hook.
	(h8300_frame_args_address): Declare.
	(h8300_frame_find_saved_regs): Declare.
	(h8300_frame_locals_address): Declare.
	(h8300_frame_saved_pc): Declare.
	(h8300_pop_frame): Declare.
	(h8300_print_register_hook): Declare.
	* h8300-tdep.c (h8300_frame_find_saved_regs): Removed declaration.
	(h8300_frame_args_address): Renamed from frame_args_address.
	(h8300_frame_locals_address): Renamed from frame_locals_address.
	(h8300_pop_frame): Renamed from pop_frame.
	(h8300_print_register_hook): Renamed from print_register_hook.

Index: h8300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/h8300-tdep.c,v
retrieving revision 1.6
diff -c -r1.6 h8300-tdep.c
*** h8300-tdep.c	2001/03/06 08:21:08	1.6
--- h8300-tdep.c	2001/03/16 22:11:54
***************
*** 71,78 ****
  static CORE_ADDR examine_prologue ();
  static void set_machine_hook (char *filename);
  
- void h8300_frame_find_saved_regs ();
- 
  CORE_ADDR
  h8300_skip_prologue (CORE_ADDR start_pc)
  {
--- 71,76 ----
***************
*** 434,440 ****
  }
  
  CORE_ADDR
! frame_locals_address (struct frame_info *fi)
  {
    if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
      return (CORE_ADDR) 0;	/* Not sure what else to do... */
--- 432,438 ----
  }
  
  CORE_ADDR
! h8300_frame_locals_address (struct frame_info *fi)
  {
    if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
      return (CORE_ADDR) 0;	/* Not sure what else to do... */
***************
*** 452,458 ****
     described by FI.  Returns 0 if the address is unknown.  */
  
  CORE_ADDR
! frame_args_address (struct frame_info *fi)
  {
    if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
      return (CORE_ADDR) 0;	/* Not sure what else to do... */
--- 450,456 ----
     described by FI.  Returns 0 if the address is unknown.  */
  
  CORE_ADDR
! h8300_frame_args_address (struct frame_info *fi)
  {
    if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
      return (CORE_ADDR) 0;	/* Not sure what else to do... */
***************
*** 611,617 ****
    return sp;
  }
  
! /* Function: pop_frame
     Restore the machine to the state it had before the current frame 
     was created.  Usually used either by the "RETURN" command, or by
     call_function_by_hand after the dummy_frame is finished. */
--- 609,615 ----
    return sp;
  }
  
! /* Function: h8300_pop_frame
     Restore the machine to the state it had before the current frame 
     was created.  Usually used either by the "RETURN" command, or by
     call_function_by_hand after the dummy_frame is finished. */
***************
*** 828,834 ****
  
  
  void
! print_register_hook (int regno)
  {
    if (regno == 8)
      {
--- 826,832 ----
  
  
  void
! h8300_print_register_hook (int regno)
  {
    if (regno == 8)
      {
Index: config/h8300/tm-h8300.h
===================================================================
RCS file: /cvs/src/src/gdb/config/h8300/tm-h8300.h,v
retrieving revision 1.6
diff -c -r1.6 tm-h8300.h
*** tm-h8300.h	2001/03/14 23:23:10	1.6
--- tm-h8300.h	2001/03/16 22:11:54
***************
*** 235,244 ****
   */
  
  #define FRAME_SAVED_PC(FRAME) h8300_frame_saved_pc(FRAME)
  
! #define FRAME_ARGS_ADDRESS(fi) frame_args_address(fi)
  
! #define FRAME_LOCALS_ADDRESS(fi) frame_locals_address(fi);
  
  /* Set VAL to the number of args passed to frame described by FI.
     Can set VAL to -1, meaning no way to tell.  */
--- 235,247 ----
   */
  
  #define FRAME_SAVED_PC(FRAME) h8300_frame_saved_pc(FRAME)
+ extern CORE_ADDR h8300_frame_saved_pc (struct frame_info *);
  
! #define FRAME_ARGS_ADDRESS(fi) h8300_frame_args_address(fi)
! extern CORE_ADDR h8300_frame_args_address (struct frame_info *);
  
! #define FRAME_LOCALS_ADDRESS(fi) h8300_frame_locals_address(fi)
! extern CORE_ADDR h8300_frame_locals_address (struct frame_info *);
  
  /* Set VAL to the number of args passed to frame described by FI.
     Can set VAL to -1, meaning no way to tell.  */
***************
*** 260,271 ****
  
  #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs)	    \
     h8300_frame_find_saved_regs(frame_info, &(frame_saved_regs))
  
  
  typedef unsigned short INSN_WORD;
  
  
! #define	PRINT_REGISTER_HOOK(regno) print_register_hook(regno)
  
  #define GDB_TARGET_IS_H8300
  
--- 263,277 ----
  
  #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs)	    \
     h8300_frame_find_saved_regs(frame_info, &(frame_saved_regs))
+ extern void h8300_frame_find_saved_regs (struct frame_info *,
+ 					 struct frame_saved_regs *);
  
  
  typedef unsigned short INSN_WORD;
  
  
! #define	PRINT_REGISTER_HOOK(regno) h8300_print_register_hook(regno)
! extern void h8300_print_register_hook (int);
  
  #define GDB_TARGET_IS_H8300
  
***************
*** 292,297 ****
--- 298,304 ----
  				       unsigned char struct_return,
  				       CORE_ADDR struct_addr);
  extern CORE_ADDR h8300_push_return_address (CORE_ADDR, CORE_ADDR);
+ extern void h8300_pop_frame (void);
  
  #define PC_IN_CALL_DUMMY(PC, SP, FP)	generic_pc_in_call_dummy (PC, SP, FP)
  #define FIX_CALL_DUMMY(DUMMY, START_SP, FUNADDR, NARGS, ARGS, TYPE, GCCP)


-- 
J.T. Conklin
RedBack Networks



More information about the Gdb-patches mailing list