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]

[rfa:sparc/rfc] multi-arch SOFTWARE_SINGLE_STEP et.al.


Hello,

(I now remember why I kept avoiding  this one :-)

The attatched multi-arches SOFTWARE_SINGLE_STEP /
SOFTWARE_SINGLE_STEP_P.  It also does a few other things so watch
carefully :-)

For the sparc64 this multi-arches software_single_step.  Maintainer?
Test on a solaris N+1 machine?

For the other targets, I've zapped SOFTWARE_SINGLE_STEP_P since
gdbarch.[ch] can now determine if that is needed.

Finally, the enum target_signal is moved to defs.h (from target.h) since
gdbarch.[hc] is now refering to it (ulgh).

Enjoy,  I managed to recompile the MAINTAINER targets (which is how I
found the sparc64 build problems).

	Andrew
Sat Jan 20 17:32:05 2001  Andrew Cagney  <cagney@b1.cygnus.com>

	* target.h (enum target_signal): Move from here.
	* defs.h (enum target_signal): To here.  Work around problem with
 	forward enum declarations.

	* gdbarch.sh (SOFTWARE_SINGLE_STEP): Add.
	* gdbarch.h, gdbarch.c: Re-generate.

	* target.h (SOFTWARE_SINGLE_STEP_P)
	(SOFTWARE_SINGLE_STEP): Delete macro definitions.

	* mips-tdep.c (mips_dump_tdep): Do not dump SOFTWARE_SINGLE_STEP
 	or SOFTWARE_SINGLE_STEP_P.
	* infrun.c (resume): Change SOFTWARE_SINGLE_STEP_P to a function.
	(handle_inferior_event): Ditto.
	* infptrace.c (child_resume): Ditto.
	* breakpoint.c (bpstat_stop_status): Ditto.

	* config/powerpc/tm-linux.h (SOFTWARE_SINGLE_STEP_P): Delete.
	* config/powerpc/tm-ppc-eabi.h (SOFTWARE_SINGLE_STEP_P): Ditto.
	* config/rs6000/tm-rs6000.h (SOFTWARE_SINGLE_STEP_P):  Ditto.
	* config/sparc/tm-sparc.h (SOFTWARE_SINGLE_STEP_P):  Ditto.
	* config/sh/tm-wince.h (SOFTWARE_SINGLE_STEP_P):  Ditto.
	* config/mips/tm-wince.h (SOFTWARE_SINGLE_STEP_P):  Ditto.
	* config/arm/tm-wince.h (SOFTWARE_SINGLE_STEP_P): Delete.
	* config/arc/tm-arc.h (SOFTWARE_SINGLE_STEP_P): Delete.
	* config/sparc/tm-sun4sol2.h (SOFTWARE_SINGLE_STEP_P): Delete.

	* config/sparc/tm-sparc.h: Only define SOFTWARE_SINGLE_STEP when
 	not multi-arch.
	* sparc-tdep.c (sparc_gdbarch_init): Install
 	sparc_software_single_step method.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.23
diff -p -r1.23 breakpoint.c
*** breakpoint.c	2001/01/18 15:42:23	1.23
--- breakpoint.c	2001/01/20 22:22:41
*************** bpstat_stop_status (CORE_ADDR *pc, int n
*** 2399,2405 ****
    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)
--- 2399,2405 ----
    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: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.34
diff -p -r1.34 defs.h
*** defs.h	2001/01/19 08:01:46	1.34
--- defs.h	2001/01/20 22:22:41
*************** enum precision_type
*** 226,231 ****
--- 226,377 ----
      unspecified_precision
    };
  
+ /* The numbering of these signals is chosen to match traditional unix
+    signals (insofar as various unices use the same numbers, anyway).
+    It is also the numbering of the GDB remote protocol.  Other remote
+    protocols, if they use a different numbering, should make sure to
+    translate appropriately.
+ 
+    Since these numbers have actually made it out into other software
+    (stubs, etc.), you mustn't disturb the assigned numbering.  If you
+    need to add new signals here, add them to the end of the explicitly
+    numbered signals.
+ 
+    This is based strongly on Unix/POSIX signals for several reasons:
+    (1) This set of signals represents a widely-accepted attempt to
+    represent events of this sort in a portable fashion, (2) we want a
+    signal to make it from wait to child_wait to the user intact, (3) many
+    remote protocols use a similar encoding.  However, it is
+    recognized that this set of signals has limitations (such as not
+    distinguishing between various kinds of SIGSEGV, or not
+    distinguishing hitting a breakpoint from finishing a single step).
+    So in the future we may get around this either by adding additional
+    signals for breakpoint, single-step, etc., or by adding signal
+    codes; the latter seems more in the spirit of what BSD, System V,
+    etc. are doing to address these issues.  */
+ 
+ /* For an explanation of what each signal means, see
+    target_signal_to_string.  */
+ 
+ /* This should probably be in target.h but isn't due to forward
+    declaration problems. */
+ 
+ enum target_signal
+   {
+     /* Used some places (e.g. stop_signal) to record the concept that
+        there is no signal.  */
+     TARGET_SIGNAL_0 = 0,
+     TARGET_SIGNAL_FIRST = 0,
+     TARGET_SIGNAL_HUP = 1,
+     TARGET_SIGNAL_INT = 2,
+     TARGET_SIGNAL_QUIT = 3,
+     TARGET_SIGNAL_ILL = 4,
+     TARGET_SIGNAL_TRAP = 5,
+     TARGET_SIGNAL_ABRT = 6,
+     TARGET_SIGNAL_EMT = 7,
+     TARGET_SIGNAL_FPE = 8,
+     TARGET_SIGNAL_KILL = 9,
+     TARGET_SIGNAL_BUS = 10,
+     TARGET_SIGNAL_SEGV = 11,
+     TARGET_SIGNAL_SYS = 12,
+     TARGET_SIGNAL_PIPE = 13,
+     TARGET_SIGNAL_ALRM = 14,
+     TARGET_SIGNAL_TERM = 15,
+     TARGET_SIGNAL_URG = 16,
+     TARGET_SIGNAL_STOP = 17,
+     TARGET_SIGNAL_TSTP = 18,
+     TARGET_SIGNAL_CONT = 19,
+     TARGET_SIGNAL_CHLD = 20,
+     TARGET_SIGNAL_TTIN = 21,
+     TARGET_SIGNAL_TTOU = 22,
+     TARGET_SIGNAL_IO = 23,
+     TARGET_SIGNAL_XCPU = 24,
+     TARGET_SIGNAL_XFSZ = 25,
+     TARGET_SIGNAL_VTALRM = 26,
+     TARGET_SIGNAL_PROF = 27,
+     TARGET_SIGNAL_WINCH = 28,
+     TARGET_SIGNAL_LOST = 29,
+     TARGET_SIGNAL_USR1 = 30,
+     TARGET_SIGNAL_USR2 = 31,
+     TARGET_SIGNAL_PWR = 32,
+     /* Similar to SIGIO.  Perhaps they should have the same number.  */
+     TARGET_SIGNAL_POLL = 33,
+     TARGET_SIGNAL_WIND = 34,
+     TARGET_SIGNAL_PHONE = 35,
+     TARGET_SIGNAL_WAITING = 36,
+     TARGET_SIGNAL_LWP = 37,
+     TARGET_SIGNAL_DANGER = 38,
+     TARGET_SIGNAL_GRANT = 39,
+     TARGET_SIGNAL_RETRACT = 40,
+     TARGET_SIGNAL_MSG = 41,
+     TARGET_SIGNAL_SOUND = 42,
+     TARGET_SIGNAL_SAK = 43,
+     TARGET_SIGNAL_PRIO = 44,
+     TARGET_SIGNAL_REALTIME_33 = 45,
+     TARGET_SIGNAL_REALTIME_34 = 46,
+     TARGET_SIGNAL_REALTIME_35 = 47,
+     TARGET_SIGNAL_REALTIME_36 = 48,
+     TARGET_SIGNAL_REALTIME_37 = 49,
+     TARGET_SIGNAL_REALTIME_38 = 50,
+     TARGET_SIGNAL_REALTIME_39 = 51,
+     TARGET_SIGNAL_REALTIME_40 = 52,
+     TARGET_SIGNAL_REALTIME_41 = 53,
+     TARGET_SIGNAL_REALTIME_42 = 54,
+     TARGET_SIGNAL_REALTIME_43 = 55,
+     TARGET_SIGNAL_REALTIME_44 = 56,
+     TARGET_SIGNAL_REALTIME_45 = 57,
+     TARGET_SIGNAL_REALTIME_46 = 58,
+     TARGET_SIGNAL_REALTIME_47 = 59,
+     TARGET_SIGNAL_REALTIME_48 = 60,
+     TARGET_SIGNAL_REALTIME_49 = 61,
+     TARGET_SIGNAL_REALTIME_50 = 62,
+     TARGET_SIGNAL_REALTIME_51 = 63,
+     TARGET_SIGNAL_REALTIME_52 = 64,
+     TARGET_SIGNAL_REALTIME_53 = 65,
+     TARGET_SIGNAL_REALTIME_54 = 66,
+     TARGET_SIGNAL_REALTIME_55 = 67,
+     TARGET_SIGNAL_REALTIME_56 = 68,
+     TARGET_SIGNAL_REALTIME_57 = 69,
+     TARGET_SIGNAL_REALTIME_58 = 70,
+     TARGET_SIGNAL_REALTIME_59 = 71,
+     TARGET_SIGNAL_REALTIME_60 = 72,
+     TARGET_SIGNAL_REALTIME_61 = 73,
+     TARGET_SIGNAL_REALTIME_62 = 74,
+     TARGET_SIGNAL_REALTIME_63 = 75,
+ 
+     /* Used internally by Solaris threads.  See signal(5) on Solaris.  */
+     TARGET_SIGNAL_CANCEL = 76,
+ 
+     /* Yes, this pains me, too.  But LynxOS didn't have SIG32, and now
+        Linux does, and we can't disturb the numbering, since it's part
+        of the protocol.  Note that in some GDB's TARGET_SIGNAL_REALTIME_32
+        is number 76.  */
+     TARGET_SIGNAL_REALTIME_32,
+     /* Yet another pain, IRIX 6 has SIG64.  */
+     TARGET_SIGNAL_REALTIME_64,
+ 
+ #if defined(MACH) || defined(__MACH__)
+     /* Mach exceptions */
+     TARGET_EXC_BAD_ACCESS,
+     TARGET_EXC_BAD_INSTRUCTION,
+     TARGET_EXC_ARITHMETIC,
+     TARGET_EXC_EMULATION,
+     TARGET_EXC_SOFTWARE,
+     TARGET_EXC_BREAKPOINT,
+ #endif
+     TARGET_SIGNAL_INFO,
+ 
+     /* Some signal we don't know about.  */
+     TARGET_SIGNAL_UNKNOWN,
+ 
+     /* Use whatever signal we use when one is not specifically specified
+        (for passing to proceed and so on).  */
+     TARGET_SIGNAL_DEFAULT,
+ 
+     /* Last and unused enum value, for sizing arrays, etc.  */
+     TARGET_SIGNAL_LAST
+   };
+ 
  /* the cleanup list records things that have to be undone
     if an error happens (descriptors to be closed, memory to be freed, etc.)
     Each link in the chain records a function to call and an
Index: gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.50
diff -p -r1.50 gdbarch.c
*** gdbarch.c	2000/12/15 12:33:07	1.50
--- gdbarch.c	2001/01/20 22:22:50
*************** struct gdbarch
*** 239,244 ****
--- 239,245 ----
    const struct floatformat * double_format;
    const struct floatformat * long_double_format;
    gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
+   gdbarch_software_single_step_ftype *software_single_step;
  };
  
  
*************** struct gdbarch startup_gdbarch =
*** 368,373 ****
--- 369,375 ----
    0,
    0,
    0,
+   0,
    /* startup_gdbarch() */
  };
  
*************** verify_gdbarch (struct gdbarch *gdbarch)
*** 692,697 ****
--- 694,700 ----
    if (gdbarch->long_double_format == 0)
      gdbarch->long_double_format = &floatformat_unknown;
    /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
+   /* Skip verify of software_single_step, has predicate */
  }
  
  
*************** gdbarch_dump (struct gdbarch *gdbarch, s
*** 1362,1367 ****
--- 1365,1377 ----
                        "CONVERT_FROM_FUNC_PTR_ADDR(addr)",
                        XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr)));
  #endif
+ #if defined (SOFTWARE_SINGLE_STEP) && GDB_MULTI_ARCH
+   /* Macro might contain `[{}]' when not multi-arch */
+   fprintf_unfiltered (file,
+                       "gdbarch_dump: %s # %s\n",
+                       "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
+                       XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
+ #endif
  #ifdef TARGET_ARCHITECTURE
    if (TARGET_ARCHITECTURE != NULL)
      fprintf_unfiltered (file,
*************** gdbarch_dump (struct gdbarch *gdbarch, s
*** 2067,2072 ****
--- 2077,2089 ----
                          (long) current_gdbarch->convert_from_func_ptr_addr
                          /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
  #endif
+ #ifdef SOFTWARE_SINGLE_STEP
+   if (GDB_MULTI_ARCH)
+     fprintf_unfiltered (file,
+                         "gdbarch_dump: SOFTWARE_SINGLE_STEP = 0x%08lx\n",
+                         (long) current_gdbarch->software_single_step
+                         /*SOFTWARE_SINGLE_STEP ()*/);
+ #endif
    if (current_gdbarch->dump_tdep != NULL)
      current_gdbarch->dump_tdep (current_gdbarch, file);
  }
*************** set_gdbarch_convert_from_func_ptr_addr (
*** 3978,3983 ****
--- 3995,4023 ----
                                          gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
  {
    gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
+ }
+ 
+ int
+ gdbarch_software_single_step_p (struct gdbarch *gdbarch)
+ {
+   return gdbarch->software_single_step != 0;
+ }
+ 
+ void
+ gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
+ {
+   if (gdbarch->software_single_step == 0)
+     internal_error ("gdbarch: gdbarch_software_single_step invalid");
+   if (gdbarch_debug >= 2)
+     fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
+   gdbarch->software_single_step (sig, insert_breakpoints_p);
+ }
+ 
+ void
+ set_gdbarch_software_single_step (struct gdbarch *gdbarch,
+                                   gdbarch_software_single_step_ftype software_single_step)
+ {
+   gdbarch->software_single_step = software_single_step;
  }
  
  
Index: gdbarch.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.h,v
retrieving revision 1.39
diff -p -r1.39 gdbarch.h
*** gdbarch.h	2000/12/15 12:33:08	1.39
--- gdbarch.h	2001/01/20 22:22:59
*************** extern void set_gdbarch_convert_from_fun
*** 1461,1466 ****
--- 1461,1504 ----
  #endif
  #endif
  
+ /* FIXME/cagney/2001-01-18: This should be split in two.  A target method that indicates if
+    the target needs software single step.  An ISA method to implement it.
+   
+    FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
+    using the breakpoint system instead of blatting memory directly (as with rs6000).
+   
+    FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the target can
+    single step.  If not, then implement single step using breakpoints. */
+ 
+ #if defined (SOFTWARE_SINGLE_STEP)
+ /* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */
+ #define SOFTWARE_SINGLE_STEP_P() (1)
+ #endif
+ 
+ /* Default predicate for non- multi-arch targets. */
+ #if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP_P)
+ #define SOFTWARE_SINGLE_STEP_P() (0)
+ #endif
+ 
+ extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
+ #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P)
+ #define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
+ #endif
+ 
+ /* Default (function) for non- multi-arch platforms. */
+ #if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP)
+ #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (internal_error ("SOFTWARE_SINGLE_STEP"), 0)
+ #endif
+ 
+ typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p);
+ extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p);
+ extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
+ #if GDB_MULTI_ARCH
+ #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP)
+ #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p))
+ #endif
+ #endif
+ 
  extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
  
  
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.50
diff -p -r1.50 gdbarch.sh
*** gdbarch.sh	2000/12/15 12:33:08	1.50
--- gdbarch.sh	2001/01/20 22:23:05
*************** v:2:TARGET_FLOAT_FORMAT:const struct flo
*** 485,490 ****
--- 485,499 ----
  v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (gdbarch)
  v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::&floatformat_unknown
  f:2:CONVERT_FROM_FUNC_PTR_ADDR:CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr:addr:::default_convert_from_func_ptr_addr::0
+ # FIXME/cagney/2001-01-18: This should be split in two.  A target method that indicates if
+ # the target needs software single step.  An ISA method to implement it.
+ #
+ # FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
+ # using the breakpoint system instead of blatting memory directly (as with rs6000).
+ #
+ # FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the target can
+ # single step.  If not, then implement single step using breakpoints.
+ F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p::0:0
  EOF
  }
  
Index: infptrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infptrace.c,v
retrieving revision 1.6
diff -p -r1.6 infptrace.c
*** infptrace.c	2000/09/09 01:38:49	1.6
--- infptrace.c	2001/01/20 22:23:08
*************** child_resume (int pid, int step, enum ta
*** 271,277 ****
  
    if (step)
      {
!       if (SOFTWARE_SINGLE_STEP_P)
  	abort ();		/* Make sure this doesn't happen. */
        else
  	ptrace (PT_STEP, pid, (PTRACE_ARG3_TYPE) 1,
--- 271,277 ----
  
    if (step)
      {
!       if (SOFTWARE_SINGLE_STEP_P ())
  	abort ();		/* Make sure this doesn't happen. */
        else
  	ptrace (PT_STEP, pid, (PTRACE_ARG3_TYPE) 1,
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.23
diff -p -r1.23 infrun.c
*** infrun.c	2000/12/15 01:01:47	1.23
--- infrun.c	2001/01/20 22:23:18
*************** resume (int step, enum target_signal sig
*** 833,839 ****
    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 */ );
--- 833,839 ----
    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_
*** 1816,1822 ****
  
      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))
--- 1816,1822 ----
  
      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_
*** 1979,1985 ****
  	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);
--- 1979,1985 ----
  	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: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.38
diff -p -r1.38 mips-tdep.c
*** mips-tdep.c	2001/01/04 23:22:45	1.38
--- mips-tdep.c	2001/01/20 22:23:30
*************** mips_dump_tdep (struct gdbarch *current_
*** 4436,4450 ****
  		      "mips_dump_tdep: SKIP_TRAMPOLINE_CODE # %s\n",
  		      XSTRING (SKIP_TRAMPOLINE_CODE (PC)));
    fprintf_unfiltered (file,
- 		      "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)));
  #ifdef STACK_END_ADDR
--- 4436,4441 ----
Index: sparc-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.c,v
retrieving revision 1.12
diff -p -r1.12 sparc-tdep.c
*** sparc-tdep.c	2001/01/02 20:37:11	1.12
--- sparc-tdep.c	2001/01/20 22:23:37
*************** sparc_gdbarch_init (struct gdbarch_info 
*** 2984,2989 ****
--- 2984,2991 ----
    set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
    set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
  
+   set_gdbarch_software_single_step (gdbarch, sparc_software_single_step);
+ 
    /*
     * Settings that depend only on 32/64 bit word size 
     */
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.10
diff -p -r1.10 target.h
*** target.h	2001/01/18 15:42:24	1.10
--- target.h	2001/01/20 22:23:42
*************** enum target_waitkind
*** 122,270 ****
      TARGET_WAITKIND_IGNORE
    };
  
- /* The numbering of these signals is chosen to match traditional unix
-    signals (insofar as various unices use the same numbers, anyway).
-    It is also the numbering of the GDB remote protocol.  Other remote
-    protocols, if they use a different numbering, should make sure to
-    translate appropriately.
- 
-    Since these numbers have actually made it out into other software
-    (stubs, etc.), you mustn't disturb the assigned numbering.  If you
-    need to add new signals here, add them to the end of the explicitly
-    numbered signals.
- 
-    This is based strongly on Unix/POSIX signals for several reasons:
-    (1) This set of signals represents a widely-accepted attempt to
-    represent events of this sort in a portable fashion, (2) we want a
-    signal to make it from wait to child_wait to the user intact, (3) many
-    remote protocols use a similar encoding.  However, it is
-    recognized that this set of signals has limitations (such as not
-    distinguishing between various kinds of SIGSEGV, or not
-    distinguishing hitting a breakpoint from finishing a single step).
-    So in the future we may get around this either by adding additional
-    signals for breakpoint, single-step, etc., or by adding signal
-    codes; the latter seems more in the spirit of what BSD, System V,
-    etc. are doing to address these issues.  */
- 
- /* For an explanation of what each signal means, see
-    target_signal_to_string.  */
- 
- enum target_signal
-   {
-     /* Used some places (e.g. stop_signal) to record the concept that
-        there is no signal.  */
-     TARGET_SIGNAL_0 = 0,
-     TARGET_SIGNAL_FIRST = 0,
-     TARGET_SIGNAL_HUP = 1,
-     TARGET_SIGNAL_INT = 2,
-     TARGET_SIGNAL_QUIT = 3,
-     TARGET_SIGNAL_ILL = 4,
-     TARGET_SIGNAL_TRAP = 5,
-     TARGET_SIGNAL_ABRT = 6,
-     TARGET_SIGNAL_EMT = 7,
-     TARGET_SIGNAL_FPE = 8,
-     TARGET_SIGNAL_KILL = 9,
-     TARGET_SIGNAL_BUS = 10,
-     TARGET_SIGNAL_SEGV = 11,
-     TARGET_SIGNAL_SYS = 12,
-     TARGET_SIGNAL_PIPE = 13,
-     TARGET_SIGNAL_ALRM = 14,
-     TARGET_SIGNAL_TERM = 15,
-     TARGET_SIGNAL_URG = 16,
-     TARGET_SIGNAL_STOP = 17,
-     TARGET_SIGNAL_TSTP = 18,
-     TARGET_SIGNAL_CONT = 19,
-     TARGET_SIGNAL_CHLD = 20,
-     TARGET_SIGNAL_TTIN = 21,
-     TARGET_SIGNAL_TTOU = 22,
-     TARGET_SIGNAL_IO = 23,
-     TARGET_SIGNAL_XCPU = 24,
-     TARGET_SIGNAL_XFSZ = 25,
-     TARGET_SIGNAL_VTALRM = 26,
-     TARGET_SIGNAL_PROF = 27,
-     TARGET_SIGNAL_WINCH = 28,
-     TARGET_SIGNAL_LOST = 29,
-     TARGET_SIGNAL_USR1 = 30,
-     TARGET_SIGNAL_USR2 = 31,
-     TARGET_SIGNAL_PWR = 32,
-     /* Similar to SIGIO.  Perhaps they should have the same number.  */
-     TARGET_SIGNAL_POLL = 33,
-     TARGET_SIGNAL_WIND = 34,
-     TARGET_SIGNAL_PHONE = 35,
-     TARGET_SIGNAL_WAITING = 36,
-     TARGET_SIGNAL_LWP = 37,
-     TARGET_SIGNAL_DANGER = 38,
-     TARGET_SIGNAL_GRANT = 39,
-     TARGET_SIGNAL_RETRACT = 40,
-     TARGET_SIGNAL_MSG = 41,
-     TARGET_SIGNAL_SOUND = 42,
-     TARGET_SIGNAL_SAK = 43,
-     TARGET_SIGNAL_PRIO = 44,
-     TARGET_SIGNAL_REALTIME_33 = 45,
-     TARGET_SIGNAL_REALTIME_34 = 46,
-     TARGET_SIGNAL_REALTIME_35 = 47,
-     TARGET_SIGNAL_REALTIME_36 = 48,
-     TARGET_SIGNAL_REALTIME_37 = 49,
-     TARGET_SIGNAL_REALTIME_38 = 50,
-     TARGET_SIGNAL_REALTIME_39 = 51,
-     TARGET_SIGNAL_REALTIME_40 = 52,
-     TARGET_SIGNAL_REALTIME_41 = 53,
-     TARGET_SIGNAL_REALTIME_42 = 54,
-     TARGET_SIGNAL_REALTIME_43 = 55,
-     TARGET_SIGNAL_REALTIME_44 = 56,
-     TARGET_SIGNAL_REALTIME_45 = 57,
-     TARGET_SIGNAL_REALTIME_46 = 58,
-     TARGET_SIGNAL_REALTIME_47 = 59,
-     TARGET_SIGNAL_REALTIME_48 = 60,
-     TARGET_SIGNAL_REALTIME_49 = 61,
-     TARGET_SIGNAL_REALTIME_50 = 62,
-     TARGET_SIGNAL_REALTIME_51 = 63,
-     TARGET_SIGNAL_REALTIME_52 = 64,
-     TARGET_SIGNAL_REALTIME_53 = 65,
-     TARGET_SIGNAL_REALTIME_54 = 66,
-     TARGET_SIGNAL_REALTIME_55 = 67,
-     TARGET_SIGNAL_REALTIME_56 = 68,
-     TARGET_SIGNAL_REALTIME_57 = 69,
-     TARGET_SIGNAL_REALTIME_58 = 70,
-     TARGET_SIGNAL_REALTIME_59 = 71,
-     TARGET_SIGNAL_REALTIME_60 = 72,
-     TARGET_SIGNAL_REALTIME_61 = 73,
-     TARGET_SIGNAL_REALTIME_62 = 74,
-     TARGET_SIGNAL_REALTIME_63 = 75,
- 
-     /* Used internally by Solaris threads.  See signal(5) on Solaris.  */
-     TARGET_SIGNAL_CANCEL = 76,
- 
-     /* Yes, this pains me, too.  But LynxOS didn't have SIG32, and now
-        Linux does, and we can't disturb the numbering, since it's part
-        of the protocol.  Note that in some GDB's TARGET_SIGNAL_REALTIME_32
-        is number 76.  */
-     TARGET_SIGNAL_REALTIME_32,
-     /* Yet another pain, IRIX 6 has SIG64.  */
-     TARGET_SIGNAL_REALTIME_64,
- 
- #if defined(MACH) || defined(__MACH__)
-     /* Mach exceptions */
-     TARGET_EXC_BAD_ACCESS,
-     TARGET_EXC_BAD_INSTRUCTION,
-     TARGET_EXC_ARITHMETIC,
-     TARGET_EXC_EMULATION,
-     TARGET_EXC_SOFTWARE,
-     TARGET_EXC_BREAKPOINT,
- #endif
-     TARGET_SIGNAL_INFO,
- 
-     /* Some signal we don't know about.  */
-     TARGET_SIGNAL_UNKNOWN,
- 
-     /* Use whatever signal we use when one is not specifically specified
-        (for passing to proceed and so on).  */
-     TARGET_SIGNAL_DEFAULT,
- 
-     /* Last and unused enum value, for sizing arrays, etc.  */
-     TARGET_SIGNAL_LAST
-   };
- 
  struct target_waitstatus
    {
      enum target_waitkind kind;
--- 122,127 ----
*************** extern enum target_signal target_signal_
*** 1387,1398 ****
  extern void push_remote_target (char *name, int from_tty);
  
  /* 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 ("SOFTWARE_SINGLE_STEP"), 0)
- #endif /* SOFTWARE_SINGLE_STEP_P */
  
  /* Blank target vector entries are initialized to target_ignore. */
  void target_ignore (void);
--- 1244,1249 ----
Index: config/arc/tm-arc.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arc/tm-arc.h,v
retrieving revision 1.3
diff -p -r1.3 tm-arc.h
*** tm-arc.h	2000/05/28 01:12:34	1.3
--- tm-arc.h	2001/01/20 22:23:44
*************** extern CORE_ADDR arc_skip_prologue (CORE
*** 61,67 ****
  
  /* 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)
  
--- 61,66 ----
Index: 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/01/20 22:23:44
***************
*** 23,31 ****
  
  #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)
  
--- 23,28 ----
Index: 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/01/20 22:23:44
***************
*** 24,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);
--- 24,30 ----
  
  #include "mips/tm-mips.h"
  
! #undef SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(sig, bp_p) wince_software_single_step (sig, bp_p)
  
  void wince_software_single_step (unsigned int, int);
Index: config/powerpc/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/powerpc/tm-linux.h,v
retrieving revision 1.6
diff -p -r1.6 tm-linux.h
*** tm-linux.h	2000/10/26 07:41:25	1.6
--- tm-linux.h	2001/01/20 22:23:44
*************** Foundation, Inc., 59 Temple Place - Suit
*** 27,35 ****
  
  /* We can single step on linux */
  #undef  SOFTWARE_SINGLE_STEP
- #define SOFTWARE_SINGLE_STEP(p,q) abort() /* 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 */
--- 27,32 ----
Index: config/powerpc/tm-ppc-eabi.h
===================================================================
RCS file: /cvs/src/src/gdb/config/powerpc/tm-ppc-eabi.h,v
retrieving revision 1.4
diff -p -r1.4 tm-ppc-eabi.h
*** tm-ppc-eabi.h	2000/11/09 09:49:00	1.4
--- tm-ppc-eabi.h	2001/01/20 22:23:44
***************
*** 24,31 ****
  /* Use generic RS6000 definitions. */
  #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 */
--- 24,30 ----
  /* Use generic RS6000 definitions. */
  #include "rs6000/tm-rs6000.h"
  /* except we want to allow single stepping */
! #undef SOFTWARE_SINGLE_STEP
  
  #undef	DEFAULT_LR_SAVE
  #define	DEFAULT_LR_SAVE 4	/* eabi saves LR at 4 off of SP */
Index: config/rs6000/tm-rs6000.h
===================================================================
RCS file: /cvs/src/src/gdb/config/rs6000/tm-rs6000.h,v
retrieving revision 1.9
diff -p -r1.9 tm-rs6000.h
*** tm-rs6000.h	2000/11/09 09:49:00	1.9
--- tm-rs6000.h	2001/01/20 22:23:47
*************** extern void aix_process_linenos (void);
*** 97,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)
  
  /* Notice when a new child process is started. */
--- 97,104 ----
  
  /* RS6000/AIX does not support PT_STEP.  Has to be simulated.  */
  
  extern void rs6000_software_single_step (unsigned int, int);
+ #undef SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(sig,bp_p) rs6000_software_single_step (sig, bp_p)
  
  /* Notice when a new child process is started. */
Index: config/sh/tm-wince.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sh/tm-wince.h,v
retrieving revision 1.2
diff -p -r1.2 tm-wince.h
*** tm-wince.h	2000/04/21 03:04:35	1.2
--- tm-wince.h	2001/01/20 22:23:47
***************
*** 22,29 ****
  #define TM_WINCE_H 1
  
  #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)
--- 22,27 ----
Index: config/sparc/tm-sparc.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-sparc.h,v
retrieving revision 1.5
diff -p -r1.5 tm-sparc.h
*** tm-sparc.h	2000/05/28 01:12:41	1.5
--- tm-sparc.h	2001/01/20 22:23:50
*************** extern void sparc32_extract_return_value
*** 734,744 ****
  #endif /* GDB_MULTI_ARCH */
  
  
  /* 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)
  
  /* We need more arguments in a frame specification for the
     "frame" or "info frame" command.  */
--- 734,749 ----
  #endif /* GDB_MULTI_ARCH */
  
  
+ #if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
+ /* The following defines must go away for MULTI_ARCH */
+ 
  /* Sparc has no reliable single step ptrace call */
  
  extern void sparc_software_single_step (unsigned int, int);
+ #undef SOFTWARE_SINGLE_STEP
  #define SOFTWARE_SINGLE_STEP(sig,bp_p) sparc_software_single_step (sig,bp_p)
+ 
+ #endif /* !GDB_MULTI_ARCH */
  
  /* We need more arguments in a frame specification for the
     "frame" or "info frame" command.  */
Index: config/sparc/tm-sun4sol2.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-sun4sol2.h,v
retrieving revision 1.5
diff -p -r1.5 tm-sun4sol2.h
*** tm-sun4sol2.h	2000/05/28 01:12:41	1.5
--- tm-sun4sol2.h	2001/01/20 22:23:50
***************
*** 27,33 ****
  /* With Sol2 it is no longer necessary to enable software single-step,
     since the /proc interface can take care of it for us in hardware.  */
  #undef SOFTWARE_SINGLE_STEP
- #undef SOFTWARE_SINGLE_STEP_P
  
  /* There are two different signal handler trampolines in Solaris2.  */
  #define IN_SIGTRAMP(pc, name) \
--- 27,32 ----

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