* configure.host: Add x86_64-*-freebsd*.
[deliverable/binutils-gdb.git] / gdb / infrun.c
index 9f94aebf15a70d73c2a82441959ea10646c0cbe8..b2e371eebb04b70f33ba5f7ff64bec6d0c8aa69d 100644 (file)
@@ -42,6 +42,8 @@
 #include "inf-loop.h"
 #include "regcache.h"
 #include "value.h"
+#include "observer.h"
+#include "language.h"
 
 /* Prototypes for local functions */
 
@@ -77,6 +79,8 @@ static int currently_stepping (struct execution_control_state *ecs);
 
 static void xdb_handle_command (char *args, int from_tty);
 
+static int prepare_to_proceed (void);
+
 void _initialize_infrun (void);
 
 int inferior_ignoring_startup_exec_events = 0;
@@ -106,21 +110,6 @@ static ptid_t previous_inferior_ptid;
 
 static int may_follow_exec = MAY_FOLLOW_EXEC;
 
-/* Dynamic function trampolines are similar to solib trampolines in that they
-   are between the caller and the callee.  The difference is that when you
-   enter a dynamic trampoline, you can't determine the callee's address.  Some
-   (usually complex) code needs to run in the dynamic trampoline to figure out
-   the callee's address.  This macro is usually called twice.  First, when we
-   enter the trampoline (looks like a normal function call at that point).  It
-   should return the PC of a point within the trampoline where the callee's
-   address is known.  Second, when we hit the breakpoint, this routine returns
-   the callee's address.  At that point, things proceed as per a step resume
-   breakpoint.  */
-
-#ifndef DYNAMIC_TRAMPOLINE_NEXTPC
-#define DYNAMIC_TRAMPOLINE_NEXTPC(pc) 0
-#endif
-
 /* If the program uses ELF-style shared libraries, then calls to
    functions in shared libraries go through stubs, which live in a
    table called the PLT (Procedure Linkage Table).  The first time the
@@ -226,13 +215,6 @@ a command like `return' or `jump' to continue execution.");
 #define HAVE_STEPPABLE_WATCHPOINT 1
 #endif
 
-#ifndef HAVE_CONTINUABLE_WATCHPOINT
-#define HAVE_CONTINUABLE_WATCHPOINT 0
-#else
-#undef  HAVE_CONTINUABLE_WATCHPOINT
-#define HAVE_CONTINUABLE_WATCHPOINT 1
-#endif
-
 #ifndef CANNOT_STEP_HW_WATCHPOINTS
 #define CANNOT_STEP_HW_WATCHPOINTS 0
 #else
@@ -306,7 +288,7 @@ int stop_after_trap;
    when running in the shell before the child program has been exec'd;
    and when running some kinds of remote stuff (FIXME?).  */
 
-int stop_soon_quietly;
+enum stop_kind stop_soon;
 
 /* Nonzero if proceed is being used for a "finish" command or a similar
    situation when stop_registers should be saved.  */
@@ -679,7 +661,7 @@ clear_proceed_status (void)
   step_frame_id = null_frame_id;
   step_over_calls = STEP_OVER_UNDEBUGGABLE;
   stop_after_trap = 0;
-  stop_soon_quietly = 0;
+  stop_soon = NO_STOP_QUIETLY;
   proceed_to_finish = 0;
   breakpoint_proceeded = 1;    /* We're about to proceed... */
 
@@ -687,6 +669,61 @@ clear_proceed_status (void)
   bpstat_clear (&stop_bpstat);
 }
 
+/* This should be suitable for any targets that support threads. */
+
+static int
+prepare_to_proceed (void)
+{
+  ptid_t wait_ptid;
+  struct target_waitstatus wait_status;
+
+  /* Get the last target status returned by target_wait().  */
+  get_last_target_status (&wait_ptid, &wait_status);
+
+  /* Make sure we were stopped either at a breakpoint, or because
+     of a Ctrl-C.  */
+  if (wait_status.kind != TARGET_WAITKIND_STOPPED
+      || (wait_status.value.sig != TARGET_SIGNAL_TRAP &&
+          wait_status.value.sig != TARGET_SIGNAL_INT))
+    {
+      return 0;
+    }
+
+  if (!ptid_equal (wait_ptid, minus_one_ptid)
+      && !ptid_equal (inferior_ptid, wait_ptid))
+    {
+      /* Switched over from WAIT_PID.  */
+      CORE_ADDR wait_pc = read_pc_pid (wait_ptid);
+
+      if (wait_pc != read_pc ())
+       {
+         /* Switch back to WAIT_PID thread.  */
+         inferior_ptid = wait_ptid;
+
+         /* FIXME: This stuff came from switch_to_thread() in
+            thread.c (which should probably be a public function).  */
+         flush_cached_frames ();
+         registers_changed ();
+         stop_pc = wait_pc;
+         select_frame (get_current_frame ());
+       }
+
+       /* We return 1 to indicate that there is a breakpoint here,
+          so we need to step over it before continuing to avoid
+          hitting it straight away. */
+       if (breakpoint_here_p (wait_pc))
+          return 1;
+    }
+
+  return 0;
+  
+}
+
+/* Record the pc of the program the last time it stopped.  This is
+   just used internally by wait_for_inferior, but need to be preserved
+   over calls to it and cleared when the inferior is started.  */
+static CORE_ADDR prev_pc;
+
 /* Basic routine for continuing the program in various fashions.
 
    ADDR is the address to resume at, or -1 for resume where stopped.
@@ -736,7 +773,6 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
       write_pc (addr);
     }
 
-#ifdef PREPARE_TO_PROCEED
   /* In a multi-threaded task we may select another thread
      and then continue or step.
 
@@ -745,15 +781,11 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
      any execution (i.e. it will report a breakpoint hit
      incorrectly).  So we must step over it first.
 
-     PREPARE_TO_PROCEED checks the current thread against the thread
+     prepare_to_proceed checks the current thread against the thread
      that reported the most recent event.  If a step-over is required
      it returns TRUE and sets the current thread to the old thread. */
-  if (PREPARE_TO_PROCEED (1) && breakpoint_here_p (read_pc ()))
-    {
-      oneproc = 1;
-    }
-
-#endif /* PREPARE_TO_PROCEED */
+  if (prepare_to_proceed () && breakpoint_here_p (read_pc ()))
+    oneproc = 1;
 
 #ifdef HP_OS_BUG
   if (trap_expected_after_continue)
@@ -792,6 +824,30 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
      inferior.  */
   gdb_flush (gdb_stdout);
 
+  /* Refresh prev_pc value just prior to resuming.  This used to be
+     done in stop_stepping, however, setting prev_pc there did not handle
+     scenarios such as inferior function calls or returning from
+     a function via the return command.  In those cases, the prev_pc
+     value was not set properly for subsequent commands.  The prev_pc value 
+     is used to initialize the starting line number in the ecs.  With an 
+     invalid value, the gdb next command ends up stopping at the position
+     represented by the next line table entry past our start position.
+     On platforms that generate one line table entry per line, this
+     is not a problem.  However, on the ia64, the compiler generates
+     extraneous line table entries that do not increase the line number.
+     When we issue the gdb next command on the ia64 after an inferior call
+     or a return command, we often end up a few instructions forward, still 
+     within the original line we started.
+
+     An attempt was made to have init_execution_control_state () refresh
+     the prev_pc value before calculating the line number.  This approach
+     did not work because on platforms that use ptrace, the pc register
+     cannot be read unless the inferior is stopped.  At that point, we
+     are not guaranteed the inferior is stopped and so the read_pc ()
+     call can fail.  Setting the prev_pc value here ensures the value is 
+     updated correctly when the inferior is stopped.  */  
+  prev_pc = read_pc ();
+
   /* Resume inferior.  */
   resume (oneproc || step || bpstat_should_step (), stop_signal);
 
@@ -805,14 +861,6 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
       normal_stop ();
     }
 }
-
-/* Record the pc and sp of the program the last time it stopped.
-   These are just used internally by wait_for_inferior, but need
-   to be preserved over calls to it and cleared when the inferior
-   is started.  */
-static CORE_ADDR prev_pc;
-static CORE_ADDR prev_func_start;
-static char *prev_func_name;
 \f
 
 /* Start remote-debugging of a machine over a serial link.  */
@@ -822,7 +870,7 @@ start_remote (void)
 {
   init_thread_list ();
   init_wait_for_inferior ();
-  stop_soon_quietly = 1;
+  stop_soon = STOP_QUIETLY;
   trap_expected = 0;
 
   /* Always go on waiting for the target, regardless of the mode. */
@@ -850,8 +898,6 @@ init_wait_for_inferior (void)
 {
   /* These are meaningless until the first time through wait_for_inferior.  */
   prev_pc = 0;
-  prev_func_start = 0;
-  prev_func_name = NULL;
 
 #ifdef HP_OS_BUG
   trap_expected_after_continue = 0;
@@ -1139,7 +1185,6 @@ context_switch (struct execution_control_state *ecs)
     {                          /* Perform infrun state context switch: */
       /* Save infrun state for the old thread.  */
       save_infrun_state (inferior_ptid, prev_pc,
-                        prev_func_start, prev_func_name,
                         trap_expected, step_resume_breakpoint,
                         through_sigtramp_breakpoint, step_range_start,
                         step_range_end, &step_frame_id,
@@ -1151,7 +1196,6 @@ context_switch (struct execution_control_state *ecs)
 
       /* Load infrun state for the new thread.  */
       load_infrun_state (ecs->ptid, &prev_pc,
-                        &prev_func_start, &prev_func_name,
                         &trap_expected, &step_resume_breakpoint,
                         &through_sigtramp_breakpoint, &step_range_start,
                         &step_range_end, &step_frame_id,
@@ -1164,6 +1208,39 @@ context_switch (struct execution_control_state *ecs)
   inferior_ptid = ecs->ptid;
 }
 
+/* Wrapper for PC_IN_SIGTRAMP that takes care of the need to find the
+   function's name.
+
+   In a classic example of "left hand VS right hand", "infrun.c" was
+   trying to improve GDB's performance by caching the result of calls
+   to calls to find_pc_partial_funtion, while at the same time
+   find_pc_partial_function was also trying to ramp up performance by
+   caching its most recent return value.  The below makes the the
+   function find_pc_partial_function solely responsibile for
+   performance issues (the local cache that relied on a global
+   variable - arrrggg - deleted).
+
+   Using the testsuite and gcov, it was found that dropping the local
+   "infrun.c" cache and instead relying on find_pc_partial_function
+   increased the number of calls to 12000 (from 10000), but the number
+   of times find_pc_partial_function's cache missed (this is what
+   matters) was only increased by only 4 (to 3569).  (A quick back of
+   envelope caculation suggests that the extra 2000 function calls
+   @1000 extra instructions per call make the 1 MIP VAX testsuite run
+   take two extra seconds, oops :-)
+
+   Long term, this function can be eliminated, replaced by the code:
+   get_frame_type(current_frame()) == SIGTRAMP_FRAME (for new
+   architectures this is very cheap).  */
+
+static int
+pc_in_sigtramp (CORE_ADDR pc)
+{
+  char *name;
+  find_pc_partial_function (pc, &name, NULL, NULL);
+  return PC_IN_SIGTRAMP (pc, name);
+}
+
 
 /* Given an execution control state that has been freshly filled in
    by an event from the inferior, figure out what it means and take
@@ -1172,7 +1249,12 @@ context_switch (struct execution_control_state *ecs)
 void
 handle_inferior_event (struct execution_control_state *ecs)
 {
-  CORE_ADDR tmp;
+  CORE_ADDR real_stop_pc;
+  /* NOTE: cagney/2003-03-28: If you're looking at this code and
+     thinking that the variable stepped_after_stopped_by_watchpoint
+     isn't used, then you're wrong!  The macro STOPPED_BY_WATCHPOINT,
+     defined in the file "config/pa/nm-hppah.h", accesses the variable
+     indirectly.  Mutter something rude about the HP merge.  */
   int stepped_after_stopped_by_watchpoint;
   int sw_single_step_trap_p = 0;
 
@@ -1185,7 +1267,15 @@ handle_inferior_event (struct execution_control_state *ecs)
     case infwait_thread_hop_state:
       /* Cancel the waiton_ptid. */
       ecs->waiton_ptid = pid_to_ptid (-1);
-      /* Fall thru to the normal_state case. */
+      /* See comments where a TARGET_WAITKIND_SYSCALL_RETURN event
+         is serviced in this loop, below. */
+      if (ecs->enable_hw_watchpoints_after_wait)
+       {
+         TARGET_ENABLE_HW_WATCHPOINTS (PIDGET (inferior_ptid));
+         ecs->enable_hw_watchpoints_after_wait = 0;
+       }
+      stepped_after_stopped_by_watchpoint = 0;
+      break;
 
     case infwait_normal_state:
       /* See comments where a TARGET_WAITKIND_SYSCALL_RETURN event
@@ -1199,6 +1289,7 @@ handle_inferior_event (struct execution_control_state *ecs)
       break;
 
     case infwait_nullified_state:
+      stepped_after_stopped_by_watchpoint = 0;
       break;
 
     case infwait_nonstep_watch_state:
@@ -1209,6 +1300,9 @@ handle_inferior_event (struct execution_control_state *ecs)
          in combination correctly?  */
       stepped_after_stopped_by_watchpoint = 1;
       break;
+
+    default:
+      internal_error (__FILE__, __LINE__, "bad switch");
     }
   ecs->infwait_state = infwait_normal_state;
 
@@ -1261,7 +1355,7 @@ handle_inferior_event (struct execution_control_state *ecs)
          might be the shell which has just loaded some objects,
          otherwise add the symbols for the newly loaded objects.  */
 #ifdef SOLIB_ADD
-      if (!stop_soon_quietly)
+      if (stop_soon == NO_STOP_QUIETLY)
        {
          /* Remove breakpoints, SOLIB_ADD might adjust
             breakpoint addresses via breakpoint_re_set.  */
@@ -1760,7 +1854,9 @@ handle_inferior_event (struct execution_control_state *ecs)
   if (stop_signal == TARGET_SIGNAL_TRAP
       || (breakpoints_inserted &&
          (stop_signal == TARGET_SIGNAL_ILL
-          || stop_signal == TARGET_SIGNAL_EMT)) || stop_soon_quietly)
+          || stop_signal == TARGET_SIGNAL_EMT))
+      || stop_soon == STOP_QUIETLY
+      || stop_soon == STOP_QUIETLY_NO_SIGSTOP)
     {
       if (stop_signal == TARGET_SIGNAL_TRAP && stop_after_trap)
        {
@@ -1768,9 +1864,24 @@ handle_inferior_event (struct execution_control_state *ecs)
          stop_stepping (ecs);
          return;
        }
-      if (stop_soon_quietly)
+
+      /* This is originated from start_remote(), start_inferior() and
+         shared libraries hook functions.  */
+      if (stop_soon == STOP_QUIETLY)
+       {
+         stop_stepping (ecs);
+         return;
+       }
+
+      /* This originates from attach_command().  We need to overwrite
+         the stop_signal here, because some kernels don't ignore a
+         SIGSTOP in a subsequent ptrace(PTRACE_SONT,SOGSTOP) call.
+         See more comments in inferior.h.  */
+      if (stop_soon == STOP_QUIETLY_NO_SIGSTOP)
        {
          stop_stepping (ecs);
+         if (stop_signal == TARGET_SIGNAL_STOP)
+           stop_signal = TARGET_SIGNAL_0;
          return;
        }
 
@@ -1815,26 +1926,30 @@ handle_inferior_event (struct execution_control_state *ecs)
          stop_print_frame = 1;
        }
 
+      /* NOTE: cagney/2003-03-29: These two checks for a random signal
+        at one stage in the past included checks for an inferior
+        function call's call dummy's return breakpoint.  The original
+        comment, that went with the test, read:
+
+        ``End of a stack dummy.  Some systems (e.g. Sony news) give
+        another signal besides SIGTRAP, so check here as well as
+        above.''
+
+         If someone ever tries to get get call dummys on a
+         non-executable stack to work (where the target would stop
+         with something like a SIGSEG), then those tests might need to
+         be re-instated.  Given, however, that the tests were only
+         enabled when momentary breakpoints were not being used, I
+         suspect that it won't be the case.  */
+
       if (stop_signal == TARGET_SIGNAL_TRAP)
        ecs->random_signal
          = !(bpstat_explains_signal (stop_bpstat)
              || trap_expected
-             || (!CALL_DUMMY_BREAKPOINT_OFFSET_P
-                 && DEPRECATED_PC_IN_CALL_DUMMY (stop_pc, read_sp (),
-                                      get_frame_base (get_current_frame ())))
              || (step_range_end && step_resume_breakpoint == NULL));
-
       else
        {
-         ecs->random_signal = !(bpstat_explains_signal (stop_bpstat)
-                                /* End of a stack dummy.  Some systems (e.g. Sony
-                                   news) give another signal besides SIGTRAP, so
-                                   check here as well as above.  */
-                                || (!CALL_DUMMY_BREAKPOINT_OFFSET_P
-                                    && DEPRECATED_PC_IN_CALL_DUMMY (stop_pc, read_sp (),
-                                                         get_frame_base
-                                                         (get_current_frame
-                                                          ()))));
+         ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
          if (!ecs->random_signal)
            stop_signal = TARGET_SIGNAL_TRAP;
        }
@@ -2176,31 +2291,6 @@ process_event_stop_test:
       return;
     }
 
-  if (!CALL_DUMMY_BREAKPOINT_OFFSET_P)
-    {
-      /* This is the old way of detecting the end of the stack dummy.
-         An architecture which defines CALL_DUMMY_BREAKPOINT_OFFSET gets
-         handled above.  As soon as we can test it on all of them, all
-         architectures should define it.  */
-
-      /* If this is the breakpoint at the end of a stack dummy,
-         just stop silently, unless the user was doing an si/ni, in which
-         case she'd better know what she's doing.  */
-
-      if (CALL_DUMMY_HAS_COMPLETED (stop_pc, read_sp (),
-                                   get_frame_base (get_current_frame ()))
-         && !step_range_end)
-       {
-         stop_print_frame = 0;
-         stop_stack_dummy = 1;
-#ifdef HP_OS_BUG
-         trap_expected_after_continue = 1;
-#endif
-         stop_stepping (ecs);
-         return;
-       }
-    }
-
   if (step_resume_breakpoint)
     {
       /* Having a step-resume breakpoint overrides anything
@@ -2273,8 +2363,8 @@ process_event_stop_test:
   ecs->update_step_sp = 1;
 
   /* Did we just take a signal?  */
-  if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
-      && !PC_IN_SIGTRAMP (prev_pc, prev_func_name)
+  if (pc_in_sigtramp (stop_pc)
+      && !pc_in_sigtramp (prev_pc)
       && INNER_THAN (read_sp (), step_sp))
     {
       /* We've just taken a signal; go until we are back to
@@ -2384,7 +2474,7 @@ process_event_stop_test:
        {
          /* We're doing a "next".  */
 
-         if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
+         if (pc_in_sigtramp (stop_pc)
              && frame_id_inner (step_frame_id,
                                 frame_id_build (read_sp (), 0)))
            /* We stepped out of a signal handler, and into its
@@ -2407,28 +2497,11 @@ process_event_stop_test:
          function.  That's what tells us (a) whether we want to step
          into it at all, and (b) what prologue we want to run to
          the end of, if we do step into it.  */
-      tmp = SKIP_TRAMPOLINE_CODE (stop_pc);
-      if (tmp != 0)
-       ecs->stop_func_start = tmp;
-      else
-       {
-         tmp = DYNAMIC_TRAMPOLINE_NEXTPC (stop_pc);
-         if (tmp)
-           {
-             struct symtab_and_line xxx;
-             /* Why isn't this s_a_l called "sr_sal", like all of the
-                other s_a_l's where this code is duplicated?  */
-             init_sal (&xxx);  /* initialize to zeroes */
-             xxx.pc = tmp;
-             xxx.section = find_pc_overlay (xxx.pc);
-             check_for_old_step_resume_breakpoint ();
-             step_resume_breakpoint =
-               set_momentary_breakpoint (xxx, null_frame_id, bp_step_resume);
-             insert_breakpoints ();
-             keep_going (ecs);
-             return;
-           }
-       }
+      real_stop_pc = skip_language_trampoline (stop_pc);
+      if (real_stop_pc == 0)
+       real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
+      if (real_stop_pc != 0)
+       ecs->stop_func_start = real_stop_pc;
 
       /* If we have line number information for the function we
          are thinking of stepping into, step into it.
@@ -2482,19 +2555,17 @@ process_event_stop_test:
      we want to proceed through the trampoline when stepping.  */
   if (IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
     {
-      CORE_ADDR tmp;
-
       /* Determine where this trampoline returns.  */
-      tmp = SKIP_TRAMPOLINE_CODE (stop_pc);
+      real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
 
       /* Only proceed through if we know where it's going.  */
-      if (tmp)
+      if (real_stop_pc)
        {
          /* And put the step-breakpoint there and go until there. */
          struct symtab_and_line sr_sal;
 
          init_sal (&sr_sal);   /* initialize to zeroes */
-         sr_sal.pc = tmp;
+         sr_sal.pc = real_stop_pc;
          sr_sal.section = find_pc_overlay (sr_sal.pc);
          /* Do not specify what the fp should be when we stop
             since on some machines the prologue
@@ -2592,8 +2663,8 @@ static void
 check_sigtramp2 (struct execution_control_state *ecs)
 {
   if (trap_expected
-      && PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
-      && !PC_IN_SIGTRAMP (prev_pc, prev_func_name)
+      && pc_in_sigtramp (stop_pc)
+      && !pc_in_sigtramp (prev_pc)
       && INNER_THAN (read_sp (), step_sp))
     {
       /* What has happened here is that we have just stepped the
@@ -2701,7 +2772,44 @@ step_over_function (struct execution_control_state *ecs)
   struct symtab_and_line sr_sal;
 
   init_sal (&sr_sal);          /* initialize to zeros */
-  sr_sal.pc = ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
+
+  /* NOTE: cagney/2003-04-06:
+
+     At this point the equality get_frame_pc() == get_frame_func()
+     should hold.  This may make it possible for this code to tell the
+     frame where it's function is, instead of the reverse.  This would
+     avoid the need to search for the frame's function, which can get
+     very messy when there is no debug info available (look at the
+     heuristic find pc start code found in targets like the MIPS).  */
+
+  /* NOTE: cagney/2003-04-06:
+
+     The intent of DEPRECATED_SAVED_PC_AFTER_CALL was to:
+
+     - provide a very light weight equivalent to frame_unwind_pc()
+     (nee FRAME_SAVED_PC) that avoids the prologue analyzer
+
+     - avoid handling the case where the PC hasn't been saved in the
+     prologue analyzer
+
+     Unfortunatly, not five lines further down, is a call to
+     get_frame_id() and that is guarenteed to trigger the prologue
+     analyzer.
+     
+     The `correct fix' is for the prologe analyzer to handle the case
+     where the prologue is incomplete (PC in prologue) and,
+     consequently, the return pc has not yet been saved.  It should be
+     noted that the prologue analyzer needs to handle this case
+     anyway: frameless leaf functions that don't save the return PC;
+     single stepping through a prologue.
+
+     The d10v handles all this by bailing out of the prologue analsis
+     when it reaches the current instruction.  */
+
+  if (DEPRECATED_SAVED_PC_AFTER_CALL_P ())
+    sr_sal.pc = ADDR_BITS_REMOVE (DEPRECATED_SAVED_PC_AFTER_CALL (get_current_frame ()));
+  else
+    sr_sal.pc = ADDR_BITS_REMOVE (frame_pc_unwind (get_current_frame ()));
   sr_sal.section = find_pc_overlay (sr_sal.pc);
 
   check_for_old_step_resume_breakpoint ();
@@ -2720,16 +2828,6 @@ step_over_function (struct execution_control_state *ecs)
 static void
 stop_stepping (struct execution_control_state *ecs)
 {
-  if (target_has_execution)
-    {
-      /* Assuming the inferior still exists, set these up for next
-         time, just like we did above if we didn't break out of the
-         loop.  */
-      prev_pc = read_pc ();
-      prev_func_start = ecs->stop_func_start;
-      prev_func_name = ecs->stop_func_name;
-    }
-
   /* Let callers know we don't want to wait for the inferior anymore.  */
   ecs->wait_some_more = 0;
 }
@@ -2743,12 +2841,6 @@ keep_going (struct execution_control_state *ecs)
 {
   /* Save the pc before execution, to compare with pc after stop.  */
   prev_pc = read_pc ();                /* Might have been DECR_AFTER_BREAK */
-  prev_func_start = ecs->stop_func_start;      /* Ok, since if DECR_PC_AFTER
-                                                  BREAK is defined, the
-                                                  original pc would not have
-                                                  been at the start of a
-                                                  function. */
-  prev_func_name = ecs->stop_func_name;
 
   if (ecs->update_step_sp)
     step_sp = read_sp ();
@@ -3109,10 +3201,10 @@ normal_stop (void)
 
   if (stop_stack_dummy)
     {
-      /* Pop the empty frame that contains the stack dummy.
-         POP_FRAME ends with a setting of the current frame, so we
-         can use that next. */
-      POP_FRAME;
+      /* Pop the empty frame that contains the stack dummy.  POP_FRAME
+         ends with a setting of the current frame, so we can use that
+         next. */
+      frame_pop (get_current_frame ());
       /* Set stop_pc to what it was before we called the function.
          Can't rely on restore_inferior_status because that only gets
          called if we don't stop in the called function.  */
@@ -3122,6 +3214,7 @@ normal_stop (void)
 
 done:
   annotate_stopped ();
+  observer_notify_normal_stop ();
 }
 
 static int
@@ -3502,7 +3595,7 @@ struct inferior_status
   enum step_over_calls_kind step_over_calls;
   CORE_ADDR step_resume_break_address;
   int stop_after_trap;
-  int stop_soon_quietly;
+  int stop_soon;
   struct regcache *stop_registers;
 
   /* These are here because if call_function_by_hand has written some
@@ -3548,7 +3641,7 @@ save_inferior_status (int restore_stack_info)
   inf_status->step_frame_id = step_frame_id;
   inf_status->step_over_calls = step_over_calls;
   inf_status->stop_after_trap = stop_after_trap;
-  inf_status->stop_soon_quietly = stop_soon_quietly;
+  inf_status->stop_soon = stop_soon;
   /* Save original bpstat chain here; replace it with copy of chain.
      If caller's caller is walking the chain, they'll be happier if we
      hand them back the original chain when restore_inferior_status is
@@ -3602,7 +3695,7 @@ restore_inferior_status (struct inferior_status *inf_status)
   step_frame_id = inf_status->step_frame_id;
   step_over_calls = inf_status->step_over_calls;
   stop_after_trap = inf_status->stop_after_trap;
-  stop_soon_quietly = inf_status->stop_soon_quietly;
+  stop_soon = inf_status->stop_soon;
   bpstat_clear (&stop_bpstat);
   stop_bpstat = inf_status->stop_bpstat;
   breakpoint_proceeded = inf_status->breakpoint_proceeded;
This page took 0.049747 seconds and 4 git commands to generate.