]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* alpha-osf1-tdep.c (alpha_osf1_init_abi): Unfortunately,
authorJoel Brobecker <brobecker@gnat.com>
Sat, 17 Aug 2002 06:12:52 +0000 (06:12 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Sat, 17 Aug 2002 06:12:52 +0000 (06:12 +0000)
        procfs appears to be broken when debugging on multi-processor
        machines. So enable software single stepping in order to avoid
        using the procfs interface to do next/step operations, using
        internal breakpoints instead.

        * infrun.c (handle_inferior_event): Readjust the stop_pc by
        DECR_PC_AFTER_BREAK when hitting a single step breakpoint, to
        make this pc address equal to the value it would have if the
        system stepping capability was used. Also set a new flag used
        to ensure that we don't readjust the PC one more time later.

        * breakpoint.c (bpstat_stop_status): Do not adjust the PC
        address by DECR_PC_AFTER_BREAK when software single step is
        in use for this architecture, as this has already been taken
        care of in handle_inferior_event().

gdb/ChangeLog
gdb/alpha-osf1-tdep.c
gdb/breakpoint.c
gdb/infrun.c

index e819fd690fa67154e69eda292fadc706bba046d4..d1f03f934776cf5476d8c1d123fb45c6d9a0bdf0 100644 (file)
@@ -1,3 +1,22 @@
+2002-08-16  Joel Brobecker  <brobecker@gnat.com>
+
+       * alpha-osf1-tdep.c (alpha_osf1_init_abi): Unfortunately,
+       procfs appears to be broken when debugging on multi-processor
+       machines. So enable software single stepping in order to avoid
+       using the procfs interface to do next/step operations, using
+       internal breakpoints instead.
+
+       * infrun.c (handle_inferior_event): Readjust the stop_pc by
+       DECR_PC_AFTER_BREAK when hitting a single step breakpoint, to
+       make this pc address equal to the value it would have if the
+       system stepping capability was used. Also set a new flag used
+       to ensure that we don't readjust the PC one more time later.
+
+       * breakpoint.c (bpstat_stop_status): Do not adjust the PC
+       address by DECR_PC_AFTER_BREAK when software single step is
+       in use for this architecture, as this has already been taken
+       care of in handle_inferior_event().
+
 2002-08-16  Joel Brobecker  <brobecker@gnat.com>
 
        * infrun.c (handle_inferior_event): Minor reformatting, to make
index 12320519ae8108f1aebcd6e49fad3737ba9ea940..ece5e2694f24027694effe0422f6e03b6a8ea965 100644 (file)
@@ -58,6 +58,10 @@ alpha_osf1_init_abi (struct gdbarch_info info,
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   set_gdbarch_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp);
+  /* The next/step support via procfs on OSF1 is broken when running
+     on multi-processor machines. We need to use software single stepping
+     instead.  */
+  set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
 
   tdep->skip_sigtramp_frame = alpha_osf1_skip_sigtramp_frame;
   tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
index 86e700eeac7a44bac8a8b4f814938ea5b77d519e..283539061ca5dbf7e7fc657c57e9a95abf1a9dea 100644 (file)
@@ -2429,8 +2429,7 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
      trace/singlestep trap event, we would not want to subtract
      DECR_PC_AFTER_BREAK from the PC. */
 
-  bp_addr = *pc - (not_a_sw_breakpoint && !SOFTWARE_SINGLE_STEP_P () ? 
-                   0 : DECR_PC_AFTER_BREAK);
+  bp_addr = *pc - (not_a_sw_breakpoint ? 0 : DECR_PC_AFTER_BREAK);
 
   ALL_BREAKPOINTS_SAFE (b, temp)
   {
index 8375b6937c18ec69167fa521c720ec348f567577..98867cc9a46cbe1e9ed7240291f601439424d36d 100644 (file)
@@ -1408,6 +1408,7 @@ handle_inferior_event (struct execution_control_state *ecs)
 {
   CORE_ADDR tmp;
   int stepped_after_stopped_by_watchpoint;
+  int sw_single_step_trap_p = 0;
 
   /* Cache the last pid/waitstatus. */
   target_last_wait_ptid = ecs->ptid;
@@ -1888,6 +1889,18 @@ handle_inferior_event (struct execution_control_state *ecs)
        }
       else if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
         {
+          /* Readjust the stop_pc as it is off by DECR_PC_AFTER_BREAK
+             compared to the value it would have if the system stepping
+             capability was used. This allows the rest of the code in
+             this function to use this address without having to worry
+             whether software single step is in use or not.  */
+          if (DECR_PC_AFTER_BREAK)
+            {
+              stop_pc -= DECR_PC_AFTER_BREAK;
+              write_pc_pid (stop_pc, ecs->ptid);
+            }
+
+          sw_single_step_trap_p = 1;
           ecs->random_signal = 0;
         }
     }
@@ -2111,14 +2124,16 @@ handle_inferior_event (struct execution_control_state *ecs)
               (&stop_pc,
                /* Pass TRUE if our reason for stopping is something other
                   than hitting a breakpoint.  We do this by checking that
+                  either we detected earlier a software single step trap or
                   1) stepping is going on and 2) we didn't hit a breakpoint
                   in a signal handler without an intervening stop in
                   sigtramp, which is detected by a new stack pointer value
                   below any usual function calling stack adjustments.  */
-               (currently_stepping (ecs)
-                && prev_pc != stop_pc - DECR_PC_AFTER_BREAK
-                && !(step_range_end
-                     && INNER_THAN (read_sp (), (step_sp - 16)))));
+               sw_single_step_trap_p
+               || (currently_stepping (ecs)
+                   && prev_pc != stop_pc - DECR_PC_AFTER_BREAK
+                   && !(step_range_end
+                        && INNER_THAN (read_sp (), (step_sp - 16)))));
          /* Following in case break condition called a
             function.  */
          stop_print_frame = 1;