]> Git Repo - binutils.git/commitdiff
* breakpoint.h, breakpoint.c (bpstat_stop_status): Add new argument
authorJim Kingdon <[email protected]>
Wed, 22 Sep 1993 01:16:50 +0000 (01:16 +0000)
committerJim Kingdon <[email protected]>
Wed, 22 Sep 1993 01:16:50 +0000 (01:16 +0000)
not_a_breakpoint.
* infrun.c (wait_for_inferior): Pass it.  Also consolidate the
test of whether we are stepping into a CURRENTLY_STEPPING macro.

gdb/ChangeLog
gdb/breakpoint.c
gdb/infrun.c

index 5726f0a7d7745056e7afcaeb7001fed9907194df..3008322e394db0b1036c4e6018ade30cc3559248 100644 (file)
@@ -1,8 +1,16 @@
+Tue Sep 21 17:48:14 1993  Jim Kingdon  ([email protected])
+
+       * breakpoint.h, breakpoint.c (bpstat_stop_status): Add new argument
+       not_a_breakpoint.
+       * infrun.c (wait_for_inferior): Pass it.  Also consolidate the
+       test of whether we are stepping into a CURRENTLY_STEPPING macro.
+
 Tue Sep 21 17:22:34 1993  K. Richard Pixley  ([email protected])
 
        * breakpoint.c (bpstat_stop_status),
          infcmd.c (step_1),
-         infrun.c (wait_for_inferior): collapse SHIFT_INST_REGS ifdef and insert macro.
+         infrun.c (wait_for_inferior): collapse SHIFT_INST_REGS ifdef
+         and insert macro.
 
        * m88k-tdep.c: include ieee-float.h.  new global target_is_m88110.
          new const struct ext_format_m88110 for float format.
index 6facde06666f5e45cdb95b87d92edb1405301a46..faa3da4cf3a6665ff7d229a2ad7860142047a045 100644 (file)
@@ -1003,14 +1003,18 @@ print_it_noop (bs)
   return -1;
 }
 
+/* Get a bpstat associated with having just stopped at address *PC
+   and frame address FRAME_ADDRESS.  Update *PC to point at the
+   breakpoint (if we hit a breakpoint).  NOT_A_BREAKPOINT is nonzero
+   if this is known to not be a real breakpoint (it could still be a
+   watchpoint, though).  */
+
 /* Determine whether we stopped at a breakpoint, etc, or whether we
    don't understand this stop.  Result is a chain of bpstat's such that:
 
        if we don't understand the stop, the result is a null pointer.
 
-       if we understand why we stopped, the result is not null, and
-       the first element of the chain contains summary "stop" and
-       "print" flags for the whole chain.
+       if we understand why we stopped, the result is not null.
 
        Each element of the chain refers to a particular breakpoint or
        watchpoint at which we have stopped.  (We may have stopped for
@@ -1021,11 +1025,11 @@ print_it_noop (bs)
 
  */
 
-       
 bpstat
-bpstat_stop_status (pc, frame_address)
+bpstat_stop_status (pc, frame_address, not_a_breakpoint)
      CORE_ADDR *pc;
      FRAME_ADDR frame_address;
+     int not_a_breakpoint;
 {
   register struct breakpoint *b;
   CORE_ADDR bp_addr;
@@ -1049,6 +1053,9 @@ bpstat_stop_status (pc, frame_address)
       if (b->type != bp_watchpoint && b->address != bp_addr)
        continue;
 
+      if (b->type != bp_watchpoint && not_a_breakpoint)
+       continue;
+
       /* Come here if it's a watchpoint, or if the break address matches */
 
       bs = bpstat_alloc (b, bs);       /* Alloc a bpstat to explain stop */
index 3656c98ed9489bb68fea7250b849099b2ca6f7b5..b3484a157c024b9f28cf96ce551f71b2544fa017 100644 (file)
@@ -481,6 +481,13 @@ wait_for_inferior ()
   sal = find_pc_line(prev_pc, 0);
   current_line = sal.line;
 
+  /* Are we stepping?  */
+#define CURRENTLY_STEPPING() ((step_resume_breakpoint == NULL \
+                              && !handling_longjmp \
+                              && (step_range_end \
+                                  || trap_expected)) \
+                             || bpstat_should_step ())
+
   while (1)
     {
       /* Clean up saved state that will become invalid.  */
@@ -696,25 +703,24 @@ wait_for_inferior ()
          else
            {
              /* See if there is a breakpoint at the current PC.  */
+             stop_bpstat = bpstat_stop_status
+               (&stop_pc, stop_frame_address,
 #if DECR_PC_AFTER_BREAK
-             /* Notice the case of stepping through a jump
-                that lands just after a breakpoint.
-                Don't confuse that with hitting the breakpoint.
-                What we check for is that 1) stepping is going on
-                and 2) the pc before the last insn does not match
-                the address of the breakpoint before the current pc.  */
-             if (prev_pc == stop_pc - DECR_PC_AFTER_BREAK
-                 || !step_range_end
-                 || step_resume_breakpoint != NULL
-                 || handling_longjmp /* FIXME */)
-#endif /* DECR_PC_AFTER_BREAK not zero */
-               {
-                 stop_bpstat =
-                   bpstat_stop_status (&stop_pc, stop_frame_address);
-                 /* Following in case break condition called a
-                    function.  */
-                 stop_print_frame = 1;
-               }
+                /* Notice the case of stepping through a jump
+                   that lands just after a breakpoint.
+                   Don't confuse that with hitting the breakpoint.
+                   What we check for is that 1) stepping is going on
+                   and 2) the pc before the last insn does not match
+                   the address of the breakpoint before the current pc.  */
+                (prev_pc != stop_pc - DECR_PC_AFTER_BREAK
+                 && CURRENTLY_STEPPING ())
+#else /* DECR_PC_AFTER_BREAK zero */
+                0
+#endif /* DECR_PC_AFTER_BREAK zero */
+                );
+             /* Following in case break condition called a
+                function.  */
+             stop_print_frame = 1;
            }
 
          if (stop_signal == SIGTRAP)
@@ -1207,10 +1213,7 @@ step_into_function:
          /* We took a signal (which we are supposed to pass through to
             the inferior, else we'd have done a break above) and we
             haven't yet gotten our trap.  Simply continue.  */
-         resume ((step_range_end && step_resume_breakpoint == NULL)
-                 || (trap_expected && step_resume_breakpoint == NULL)
-                 || bpstat_should_step (),
-                 stop_signal);
+         resume (CURRENTLY_STEPPING (), stop_signal);
        }
       else
        {
@@ -1267,12 +1270,7 @@ step_into_function:
             }
 #endif /* SHIFT_INST_REGS */
 
-         resume ((step_resume_breakpoint == NULL
-                  && !handling_longjmp
-                  && (step_range_end
-                      || trap_expected))
-                 || bpstat_should_step (),
-                 stop_signal);
+         resume (CURRENTLY_STEPPING (), stop_signal);
        }
     }
 
This page took 0.050532 seconds and 4 git commands to generate.