[patch] SOFTWARE_SINGLE_STEP_P -> SOFTWARE_SINGLE_STEP_P()

Andrew Cagney ac131313@cygnus.com
Tue Mar 20 10:14:00 GMT 2001


FYI,

I'm about to check in the attatched.  It simply (obviously :-) converts
all instances of the macro:

	#define SOFTWARE_SINGLE_STEP_P  0
into	#define SOFTWARE_SINGLE_STEP_P() 0

The old definition clashs with multi-arch's convention for predicate
functions.

	Andrew
2001-03-20  Andrew Cagney  <ac131313@redhat.com>

	* target.h (SOFTWARE_SINGLE_STEP_P): Add empty parameter list.
	* breakpoint.c (bpstat_stop_status): Update.
	* infrun.c (handle_inferior_event): Ditto.
	* mips-tdep.c (mips_dump_tdep): Ditto.
	* infrun.c (resume): Ditto.
	* infptrace.c (child_resume): Ditto.
	* config/mips/tm-wince.h (SOFTWARE_SINGLE_STEP_P): Ditto.
	* config/sh/tm-wince.h (SOFTWARE_SINGLE_STEP_P): Ditto.
	* config/sparc/tm-sparc.h (SOFTWARE_SINGLE_STEP_P): Ditto.
	* config/powerpc/tm-linux.h (SOFTWARE_SINGLE_STEP_P): Ditto.
	* config/arm/tm-wince.h (SOFTWARE_SINGLE_STEP_P): Ditto.
	* config/arc/tm-arc.h (SOFTWARE_SINGLE_STEP_P): Ditto.
	* config/powerpc/tm-ppc-eabi.h (SOFTWARE_SINGLE_STEP_P): Ditto.

Index: gdb/doc/ChangeLog
2001-03-20  Andrew Cagney  <ac131313@redhat.com>

	* gdbint.texinfo (Target Architecture Definition): Update
	definition of SOFTWARE_SINGLE_STEP_P to include empty parameter
	list.

Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.28
diff -p -r1.28 breakpoint.c
*** breakpoint.c	2001/03/20 09:46:00	1.28
--- breakpoint.c	2001/03/20 18:04:38
*************** bpstat_stop_status (CORE_ADDR *pc, int n
*** 2395,2401 ****
    char message[sizeof (message1) + 30 /* slop */ ];
  
    /* Get the address where the breakpoint would have been.  */
!   bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P ? 
                     0 : DECR_PC_AFTER_BREAK);
  
    ALL_BREAKPOINTS_SAFE (b, temp)
--- 2395,2401 ----
    char message[sizeof (message1) + 30 /* slop */ ];
  
    /* Get the address where the breakpoint would have been.  */
!   bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P () ? 
                     0 : DECR_PC_AFTER_BREAK);
  
    ALL_BREAKPOINTS_SAFE (b, temp)
Index: gdb/infptrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infptrace.c,v
retrieving revision 1.12
diff -p -r1.12 infptrace.c
*** infptrace.c	2001/03/13 23:31:13	1.12
--- infptrace.c	2001/03/20 18:04:38
*************** child_resume (int pid, int step, enum ta
*** 273,279 ****
  
    if (step)
      {
!       if (SOFTWARE_SINGLE_STEP_P)
  	internal_error (__FILE__, __LINE__, "failed internal consistency check");		/* Make sure this doesn't happen. */
        else
  	ptrace (PT_STEP, pid, (PTRACE_ARG3_TYPE) 1,
--- 273,279 ----
  
    if (step)
      {
!       if (SOFTWARE_SINGLE_STEP_P ())
  	internal_error (__FILE__, __LINE__, "failed internal consistency check");		/* Make sure this doesn't happen. */
        else
  	ptrace (PT_STEP, pid, (PTRACE_ARG3_TYPE) 1,
Index: gdb/infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.27
diff -p -r1.27 infrun.c
*** infrun.c	2001/03/06 08:21:08	1.27
--- infrun.c	2001/03/20 18:04:40
*************** resume (int step, enum target_signal sig
*** 838,844 ****
    if (breakpoint_here_p (read_pc ()) == permanent_breakpoint_here)
      SKIP_PERMANENT_BREAKPOINT ();
  
!   if (SOFTWARE_SINGLE_STEP_P && step)
      {
        /* Do it the hard way, w/temp breakpoints */
        SOFTWARE_SINGLE_STEP (sig, 1 /*insert-breakpoints */ );
--- 838,844 ----
    if (breakpoint_here_p (read_pc ()) == permanent_breakpoint_here)
      SKIP_PERMANENT_BREAKPOINT ();
  
!   if (SOFTWARE_SINGLE_STEP_P () && step)
      {
        /* Do it the hard way, w/temp breakpoints */
        SOFTWARE_SINGLE_STEP (sig, 1 /*insert-breakpoints */ );
*************** handle_inferior_event (struct execution_
*** 1562,1568 ****
  					  (LONGEST) ecs->ws.value.integer));
  	gdb_flush (gdb_stdout);
  	target_mourn_inferior ();
! 	singlestep_breakpoints_inserted_p = 0;	/*SOFTWARE_SINGLE_STEP_P */
  	stop_print_frame = 0;
  	stop_stepping (ecs);
  	return;
--- 1562,1568 ----
  					  (LONGEST) ecs->ws.value.integer));
  	gdb_flush (gdb_stdout);
  	target_mourn_inferior ();
! 	singlestep_breakpoints_inserted_p = 0;	/*SOFTWARE_SINGLE_STEP_P() */
  	stop_print_frame = 0;
  	stop_stepping (ecs);
  	return;
*************** handle_inferior_event (struct execution_
*** 1580,1586 ****
  	target_mourn_inferior ();
  
  	print_stop_reason (SIGNAL_EXITED, stop_signal);
! 	singlestep_breakpoints_inserted_p = 0;	/*SOFTWARE_SINGLE_STEP_P */
  	stop_stepping (ecs);
  	return;
  
--- 1580,1586 ----
  	target_mourn_inferior ();
  
  	print_stop_reason (SIGNAL_EXITED, stop_signal);
! 	singlestep_breakpoints_inserted_p = 0;	/*SOFTWARE_SINGLE_STEP_P() */
  	stop_stepping (ecs);
  	return;
  
*************** handle_inferior_event (struct execution_
*** 1821,1827 ****
  
      if (stop_signal == TARGET_SIGNAL_TRAP)
        {
! 	if (SOFTWARE_SINGLE_STEP_P && singlestep_breakpoints_inserted_p)
  	  ecs->random_signal = 0;
  	else if (breakpoints_inserted
  		 && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK))
--- 1821,1827 ----
  
      if (stop_signal == TARGET_SIGNAL_TRAP)
        {
! 	if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
  	  ecs->random_signal = 0;
  	else if (breakpoints_inserted
  		 && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK))
*************** handle_inferior_event (struct execution_
*** 1984,1990 ****
  	flush_cached_frames ();
        }
  
!     if (SOFTWARE_SINGLE_STEP_P && singlestep_breakpoints_inserted_p)
        {
  	/* Pull the single step breakpoints out of the target. */
  	SOFTWARE_SINGLE_STEP (0, 0);
--- 1984,1990 ----
  	flush_cached_frames ();
        }
  
!     if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
        {
  	/* Pull the single step breakpoints out of the target. */
  	SOFTWARE_SINGLE_STEP (0, 0);
Index: gdb/mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.44
diff -p -r1.44 mips-tdep.c
*** mips-tdep.c	2001/03/06 08:21:10	1.44
--- mips-tdep.c	2001/03/20 18:04:42
*************** mips_dump_tdep (struct gdbarch *current_
*** 4470,4480 ****
  		      "mips_dump_tdep: SOFTWARE_SINGLE_STEP # %s\n",
  		      XSTRING (SOFTWARE_SINGLE_STEP (SIG, BP_P)));
    fprintf_unfiltered (file,
! 		      "mips_dump_tdep: SOFTWARE_SINGLE_STEP_P = %d\n",
! 		      SOFTWARE_SINGLE_STEP_P);
!   fprintf_unfiltered (file,
! 		      "mips_dump_tdep: SOFTWARE_SINGLE_STEP_P = %d\n",
! 		      SOFTWARE_SINGLE_STEP_P);
    fprintf_unfiltered (file,
  		      "mips_dump_tdep: STAB_REG_TO_REGNUM # %s\n",
  		      XSTRING (STAB_REG_TO_REGNUM (REGNUM)));
--- 4470,4477 ----
  		      "mips_dump_tdep: SOFTWARE_SINGLE_STEP # %s\n",
  		      XSTRING (SOFTWARE_SINGLE_STEP (SIG, BP_P)));
    fprintf_unfiltered (file,
! 		      "mips_dump_tdep: SOFTWARE_SINGLE_STEP_P () = %d\n",
! 		      SOFTWARE_SINGLE_STEP_P ());
    fprintf_unfiltered (file,
  		      "mips_dump_tdep: STAB_REG_TO_REGNUM # %s\n",
  		      XSTRING (STAB_REG_TO_REGNUM (REGNUM)));
Index: gdb/target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.14
diff -p -r1.14 target.h
*** target.h	2001/03/06 08:21:17	1.14
--- target.h	2001/03/20 18:04:48
*************** extern void push_remote_target (char *na
*** 1395,1401 ****
  /* Imported from machine dependent code */
  
  #ifndef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P 0
  #define SOFTWARE_SINGLE_STEP(sig,bp_p)	\
       (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
  #endif /* SOFTWARE_SINGLE_STEP_P */
--- 1395,1401 ----
  /* Imported from machine dependent code */
  
  #ifndef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P() 0
  #define SOFTWARE_SINGLE_STEP(sig,bp_p)	\
       (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
  #endif /* SOFTWARE_SINGLE_STEP_P */
Index: gdb/config/arc/tm-arc.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arc/tm-arc.h,v
retrieving revision 1.5
diff -p -r1.5 tm-arc.h
*** tm-arc.h	2001/03/14 23:23:08	1.5
--- tm-arc.h	2001/03/20 18:04:48
*************** extern CORE_ADDR arc_skip_prologue (CORE
*** 63,69 ****
  
  /* We don't have a reliable single step facility.
     ??? We do have a cycle single step facility, but that won't work.  */
! #define SOFTWARE_SINGLE_STEP_P 1
  extern void arc_software_single_step (unsigned int, int);
  #define SOFTWARE_SINGLE_STEP(sig,bp_p) arc_software_single_step (sig, bp_p)
  
--- 63,69 ----
  
  /* We don't have a reliable single step facility.
     ??? We do have a cycle single step facility, but that won't work.  */
! #define SOFTWARE_SINGLE_STEP_P() 1
  extern void arc_software_single_step (unsigned int, int);
  #define SOFTWARE_SINGLE_STEP(sig,bp_p) arc_software_single_step (sig, bp_p)
  
Index: gdb/config/arm/tm-wince.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-wince.h,v
retrieving revision 1.2
diff -p -r1.2 tm-wince.h
*** tm-wince.h	2000/04/07 22:26:11	1.2
--- tm-wince.h	2001/03/20 18:04:48
***************
*** 24,30 ****
  #include "arm/tm-arm.h"
  
  #undef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P 1
  
  #undef SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(sig, bp_p) wince_software_single_step (sig, bp_p)
--- 24,30 ----
  #include "arm/tm-arm.h"
  
  #undef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P() 1
  
  #undef SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(sig, bp_p) wince_software_single_step (sig, bp_p)
Index: gdb/config/mips/tm-wince.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-wince.h,v
retrieving revision 1.2
diff -p -r1.2 tm-wince.h
*** tm-wince.h	2000/03/25 03:37:35	1.2
--- tm-wince.h	2001/03/20 18:04:48
***************
*** 25,31 ****
  #include "mips/tm-mips.h"
  
  #undef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P 1
  #define SOFTWARE_SINGLE_STEP(sig, bp_p) wince_software_single_step (sig, bp_p)
  
  void wince_software_single_step (unsigned int, int);
--- 25,31 ----
  #include "mips/tm-mips.h"
  
  #undef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P() 1
  #define SOFTWARE_SINGLE_STEP(sig, bp_p) wince_software_single_step (sig, bp_p)
  
  void wince_software_single_step (unsigned int, int);
Index: gdb/config/powerpc/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/powerpc/tm-linux.h,v
retrieving revision 1.8
diff -p -r1.8 tm-linux.h
*** tm-linux.h	2001/03/20 17:48:17	1.8
--- tm-linux.h	2001/03/20 18:04:48
*************** Foundation, Inc., 59 Temple Place - Suit
*** 29,35 ****
  #undef  SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(p,q) internal_error (__FILE__, __LINE__, "Will never execute!")
  #undef  SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P 0
  
  /* Make sure nexti gets the help it needs for debugging assembly code
     without symbols */
--- 29,35 ----
  #undef  SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(p,q) internal_error (__FILE__, __LINE__, "Will never execute!")
  #undef  SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P() 0
  
  /* Make sure nexti gets the help it needs for debugging assembly code
     without symbols */
Index: gdb/config/powerpc/tm-ppc-eabi.h
===================================================================
RCS file: /cvs/src/src/gdb/config/powerpc/tm-ppc-eabi.h,v
retrieving revision 1.5
diff -p -r1.5 tm-ppc-eabi.h
*** tm-ppc-eabi.h	2001/03/06 08:21:34	1.5
--- tm-ppc-eabi.h	2001/03/20 18:04:49
***************
*** 26,32 ****
  #include "rs6000/tm-rs6000.h"
  /* except we want to allow single stepping */
  #undef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P 0
  
  #undef	DEFAULT_LR_SAVE
  #define	DEFAULT_LR_SAVE 4	/* eabi saves LR at 4 off of SP */
--- 26,32 ----
  #include "rs6000/tm-rs6000.h"
  /* except we want to allow single stepping */
  #undef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P() 0
  
  #undef	DEFAULT_LR_SAVE
  #define	DEFAULT_LR_SAVE 4	/* eabi saves LR at 4 off of SP */
Index: gdb/config/rs6000/tm-rs6000.h
===================================================================
RCS file: /cvs/src/src/gdb/config/rs6000/tm-rs6000.h,v
retrieving revision 1.10
diff -p -r1.10 tm-rs6000.h
*** tm-rs6000.h	2001/03/06 08:21:35	1.10
--- tm-rs6000.h	2001/03/20 18:04:49
*************** extern void aix_process_linenos (void);
*** 98,104 ****
  
  /* RS6000/AIX does not support PT_STEP.  Has to be simulated.  */
  
! #define SOFTWARE_SINGLE_STEP_P 1
  extern void rs6000_software_single_step (unsigned int, int);
  #define SOFTWARE_SINGLE_STEP(sig,bp_p) rs6000_software_single_step (sig, bp_p)
  
--- 98,104 ----
  
  /* RS6000/AIX does not support PT_STEP.  Has to be simulated.  */
  
! #define SOFTWARE_SINGLE_STEP_P() 1
  extern void rs6000_software_single_step (unsigned int, int);
  #define SOFTWARE_SINGLE_STEP(sig,bp_p) rs6000_software_single_step (sig, bp_p)
  
Index: gdb/config/sh/tm-wince.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sh/tm-wince.h,v
retrieving revision 1.3
diff -p -r1.3 tm-wince.h
*** tm-wince.h	2001/03/06 08:21:35	1.3
--- tm-wince.h	2001/03/20 18:04:49
***************
*** 23,29 ****
  
  #include "sh/tm-sh.h"
  #undef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P 1
  
  #undef SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(sig, bp_p) wince_software_single_step (sig, bp_p)
--- 23,29 ----
  
  #include "sh/tm-sh.h"
  #undef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P() 1
  
  #undef SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(sig, bp_p) wince_software_single_step (sig, bp_p)
Index: gdb/config/sparc/tm-sparc.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-sparc.h,v
retrieving revision 1.7
diff -p -r1.7 tm-sparc.h
*** tm-sparc.h	2001/03/14 23:23:14	1.7
--- tm-sparc.h	2001/03/20 18:04:49
*************** extern void sparc32_extract_return_value
*** 739,745 ****
  
  /* Sparc has no reliable single step ptrace call */
  
! #define SOFTWARE_SINGLE_STEP_P 1
  extern void sparc_software_single_step (unsigned int, int);
  #define SOFTWARE_SINGLE_STEP(sig,bp_p) sparc_software_single_step (sig,bp_p)
  
--- 739,745 ----
  
  /* Sparc has no reliable single step ptrace call */
  
! #define SOFTWARE_SINGLE_STEP_P() 1
  extern void sparc_software_single_step (unsigned int, int);
  #define SOFTWARE_SINGLE_STEP(sig,bp_p) sparc_software_single_step (sig,bp_p)
  
Index: gdb/doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.20
diff -p -r1.20 gdbint.texinfo
*** gdbint.texinfo	2001/03/06 08:21:42	1.20
--- gdbint.texinfo	2001/03/20 18:05:08
*************** languages, these predicates will always 
*** 2151,2157 ****
  array type.  All the references above to arrays being returned by value
  apply only to other languages.
  
! @item SOFTWARE_SINGLE_STEP_P
  @findex SOFTWARE_SINGLE_STEP_P
  Define this as 1 if the target does not have a hardware single-step
  mechanism.  The macro @code{SOFTWARE_SINGLE_STEP} must also be defined.
--- 2151,2157 ----
  array type.  All the references above to arrays being returned by value
  apply only to other languages.
  
! @item SOFTWARE_SINGLE_STEP_P()
  @findex SOFTWARE_SINGLE_STEP_P
  Define this as 1 if the target does not have a hardware single-step
  mechanism.  The macro @code{SOFTWARE_SINGLE_STEP} must also be defined.


More information about the Gdb-patches mailing list