* gdbarch.sh (software_single_step): Replace REGCACHE argument by
[deliverable/binutils-gdb.git] / gdb / infrun.c
index f1dbd11c3beb370ff2ec4b6b04d7255fbb1106f2..ae530b77e212115361e7b6e0991b91dd063176f8 100644 (file)
@@ -176,34 +176,10 @@ show_debug_infrun (struct ui_file *file, int from_tty,
 #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) 0
 #endif
 
-/* We can't step off a permanent breakpoint in the ordinary way, because we
-   can't remove it.  Instead, we have to advance the PC to the next
-   instruction.  This macro should expand to a pointer to a function that
-   does that, or zero if we have no such function.  If we don't have a
-   definition for it, we have to report an error.  */
-#ifndef SKIP_PERMANENT_BREAKPOINT
-#define SKIP_PERMANENT_BREAKPOINT (default_skip_permanent_breakpoint)
-static void
-default_skip_permanent_breakpoint (void)
-{
-  error (_("\
-The program is stopped at a permanent breakpoint, but GDB does not know\n\
-how to step past a permanent breakpoint on this architecture.  Try using\n\
-a command like `return' or `jump' to continue execution."));
-}
-#endif
-
 
 /* Convert the #defines into values.  This is temporary until wfi control
    flow is completely sorted out.  */
 
-#ifndef HAVE_STEPPABLE_WATCHPOINT
-#define HAVE_STEPPABLE_WATCHPOINT 0
-#else
-#undef  HAVE_STEPPABLE_WATCHPOINT
-#define HAVE_STEPPABLE_WATCHPOINT 1
-#endif
-
 #ifndef CANNOT_STEP_HW_WATCHPOINTS
 #define CANNOT_STEP_HW_WATCHPOINTS 0
 #else
@@ -288,10 +264,6 @@ int proceed_to_finish;
 
 struct regcache *stop_registers;
 
-/* Nonzero if program stopped due to error trying to insert breakpoints.  */
-
-static int breakpoints_failed;
-
 /* Nonzero after stop if current stack frame should be printed.  */
 
 static int stop_print_frame;
@@ -469,6 +441,9 @@ static int singlestep_breakpoints_inserted_p = 0;
 /* The thread we inserted single-step breakpoints for.  */
 static ptid_t singlestep_ptid;
 
+/* PC when we started this single-step.  */
+static CORE_ADDR singlestep_pc;
+
 /* If another thread hit the singlestep breakpoint, we save the original
    thread here so that we can resume single-stepping it later.  */
 static ptid_t saved_singlestep_ptid;
@@ -551,18 +526,29 @@ resume (int step, enum target_signal sig)
      at a permanent breakpoint; we need to step over it, but permanent
      breakpoints can't be removed.  So we have to test for it here.  */
   if (breakpoint_here_p (read_pc ()) == permanent_breakpoint_here)
-    SKIP_PERMANENT_BREAKPOINT ();
+    {
+      if (gdbarch_skip_permanent_breakpoint_p (current_gdbarch))
+       gdbarch_skip_permanent_breakpoint (current_gdbarch, current_regcache);
+      else
+       error (_("\
+The program is stopped at a permanent breakpoint, but GDB does not know\n\
+how to step past a permanent breakpoint on this architecture.  Try using\n\
+a command like `return' or `jump' to continue execution."));
+    }
 
   if (SOFTWARE_SINGLE_STEP_P () && step)
     {
       /* Do it the hard way, w/temp breakpoints */
-      SOFTWARE_SINGLE_STEP (sig, 1 /*insert-breakpoints */ );
-      /* ...and don't ask hardware to do it.  */
-      step = 0;
-      /* and do not pull these breakpoints until after a `wait' in
-         `wait_for_inferior' */
-      singlestep_breakpoints_inserted_p = 1;
-      singlestep_ptid = inferior_ptid;
+      if (SOFTWARE_SINGLE_STEP (get_current_frame ()))
+        {
+          /* ...and don't ask hardware to do it.  */
+          step = 0;
+          /* and do not pull these breakpoints until after a `wait' in
+          `wait_for_inferior' */
+          singlestep_breakpoints_inserted_p = 1;
+          singlestep_ptid = inferior_ptid;
+          singlestep_pc = read_pc ();
+        }
     }
 
   /* If there were any forks/vforks/execs that were caught and are
@@ -614,7 +600,7 @@ resume (int step, enum target_signal sig)
          resume_ptid = inferior_ptid;
        }
 
-      if (CANNOT_STEP_BREAKPOINT)
+      if (gdbarch_cannot_step_breakpoint (current_gdbarch))
        {
          /* Most targets can step a breakpoint instruction, thus
             executing it normally.  But if this one cannot, just
@@ -682,10 +668,9 @@ prepare_to_proceed (void)
 
          /* FIXME: This stuff came from switch_to_thread() in
             thread.c (which should probably be a public function).  */
-         flush_cached_frames ();
+         reinit_frame_cache ();
          registers_changed ();
          stop_pc = wait_pc;
-         select_frame (get_current_frame ());
        }
 
       /* We return 1 to indicate that there is a breakpoint here,
@@ -900,12 +885,8 @@ enum infwait_states
    to the interface from within handle_inferior_event(). */
 enum inferior_stop_reason
 {
-  /* We don't know why. */
-  STOP_UNKNOWN,
   /* Step, next, nexti, stepi finished. */
   END_STEPPING_RANGE,
-  /* Found breakpoint. */
-  BREAKPOINT_HIT,
   /* Inferior terminated by signal. */
   SIGNAL_EXITED,
   /* Inferior exited. */
@@ -1126,6 +1107,14 @@ context_switch (struct execution_control_state *ecs)
      be lost.  This may happen as a result of the target module
      mishandling thread creation.  */
 
+  if (debug_infrun)
+    {
+      fprintf_unfiltered (gdb_stdlog, "infrun: Switching context from %s ",
+                         target_pid_to_str (inferior_ptid));
+      fprintf_unfiltered (gdb_stdlog, "to %s\n",
+                         target_pid_to_str (ecs->ptid));
+    }
+
   if (in_thread_list (inferior_ptid) && in_thread_list (ecs->ptid))
     {                          /* Perform infrun state context switch: */
       /* Save infrun state for the old thread.  */
@@ -1149,6 +1138,7 @@ context_switch (struct execution_control_state *ecs)
                         &ecs->current_line, &ecs->current_symtab);
     }
   inferior_ptid = ecs->ptid;
+  reinit_frame_cache ();
 }
 
 static void
@@ -1158,29 +1148,29 @@ adjust_pc_after_break (struct execution_control_state *ecs)
 
   /* If this target does not decrement the PC after breakpoints, then
      we have nothing to do.  */
-  if (DECR_PC_AFTER_BREAK == 0)
+  if (gdbarch_decr_pc_after_break (current_gdbarch) == 0)
     return;
 
   /* If we've hit a breakpoint, we'll normally be stopped with SIGTRAP.  If
      we aren't, just return.
 
      We assume that waitkinds other than TARGET_WAITKIND_STOPPED are not
-     affected by DECR_PC_AFTER_BREAK.  Other waitkinds which are implemented
-     by software breakpoints should be handled through the normal breakpoint
-     layer.
+     affected by gdbarch_decr_pc_after_break.  Other waitkinds which are
+     implemented by software breakpoints should be handled through the normal
+     breakpoint layer.
 
      NOTE drow/2004-01-31: On some targets, breakpoints may generate
      different signals (SIGILL or SIGEMT for instance), but it is less
      clear where the PC is pointing afterwards.  It may not match
-     DECR_PC_AFTER_BREAK.  I don't know any specific target that generates
-     these signals at breakpoints (the code has been in GDB since at least
-     1992) so I can not guess how to handle them here.
+     gdbarch_decr_pc_after_break.  I don't know any specific target that
+     generates these signals at breakpoints (the code has been in GDB since at
+     least 1992) so I can not guess how to handle them here.
 
-     In earlier versions of GDB, a target with HAVE_NONSTEPPABLE_WATCHPOINTS
-     would have the PC after hitting a watchpoint affected by
-     DECR_PC_AFTER_BREAK.  I haven't found any target with both of these set
-     in GDB history, and it seems unlikely to be correct, so
-     HAVE_NONSTEPPABLE_WATCHPOINTS is not checked here.  */
+     In earlier versions of GDB, a target with 
+     gdbarch_have_nonsteppable_watchpoint would have the PC after hitting a
+     watchpoint affected by gdbarch_decr_pc_after_break.  I haven't found any
+     target with both of these set in GDB history, and it seems unlikely to be
+     correct, so gdbarch_have_nonsteppable_watchpoint is not checked here.  */
 
   if (ecs->ws.kind != TARGET_WAITKIND_STOPPED)
     return;
@@ -1190,7 +1180,8 @@ adjust_pc_after_break (struct execution_control_state *ecs)
 
   /* Find the location where (if we've hit a breakpoint) the
      breakpoint would be.  */
-  breakpoint_pc = read_pc_pid (ecs->ptid) - DECR_PC_AFTER_BREAK;
+  breakpoint_pc = read_pc_pid (ecs->ptid) - gdbarch_decr_pc_after_break
+                                           (current_gdbarch);
 
   if (SOFTWARE_SINGLE_STEP_P ())
     {
@@ -1295,7 +1286,7 @@ handle_inferior_event (struct execution_control_state *ecs)
     }
   ecs->infwait_state = infwait_normal_state;
 
-  flush_cached_frames ();
+  reinit_frame_cache ();
 
   /* If it's a new process, add it to the thread database */
 
@@ -1381,7 +1372,7 @@ handle_inferior_event (struct execution_control_state *ecs)
                                           (LONGEST) ecs->ws.value.integer));
       gdb_flush (gdb_stdout);
       target_mourn_inferior ();
-      singlestep_breakpoints_inserted_p = 0;   /*SOFTWARE_SINGLE_STEP_P() */
+      singlestep_breakpoints_inserted_p = 0;   /* SOFTWARE_SINGLE_STEP_P() */
       stop_print_frame = 0;
       stop_stepping (ecs);
       return;
@@ -1401,7 +1392,7 @@ handle_inferior_event (struct execution_control_state *ecs)
       target_mourn_inferior ();
 
       print_stop_reason (SIGNAL_EXITED, stop_signal);
-      singlestep_breakpoints_inserted_p = 0;   /*SOFTWARE_SINGLE_STEP_P() */
+      singlestep_breakpoints_inserted_p = 0;   /* SOFTWARE_SINGLE_STEP_P() */
       stop_stepping (ecs);
       return;
 
@@ -1420,7 +1411,7 @@ handle_inferior_event (struct execution_control_state *ecs)
       if (!ptid_equal (ecs->ptid, inferior_ptid))
        {
          context_switch (ecs);
-         flush_cached_frames ();
+         reinit_frame_cache ();
        }
 
       stop_pc = read_pc ();
@@ -1481,7 +1472,7 @@ handle_inferior_event (struct execution_control_state *ecs)
       if (!ptid_equal (ecs->ptid, inferior_ptid))
        {
          context_switch (ecs);
-         flush_cached_frames ();
+         reinit_frame_cache ();
        }
 
       /* If no catchpoint triggered for this, then keep going.  */
@@ -1572,7 +1563,7 @@ handle_inferior_event (struct execution_control_state *ecs)
          if (debug_infrun)
            fprintf_unfiltered (gdb_stdlog, "infrun: stepping_past_singlestep_breakpoint\n");
          /* Pull the single step breakpoints out of the target.  */
-         SOFTWARE_SINGLE_STEP (0, 0);
+         remove_single_step_breakpoints ();
          singlestep_breakpoints_inserted_p = 0;
 
          ecs->random_signal = 0;
@@ -1609,6 +1600,14 @@ handle_inferior_event (struct execution_control_state *ecs)
        }
       else if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
        {
+         /* We have not context switched yet, so this should be true
+            no matter which thread hit the singlestep breakpoint.  */
+         gdb_assert (ptid_equal (inferior_ptid, singlestep_ptid));
+         if (debug_infrun)
+           fprintf_unfiltered (gdb_stdlog, "infrun: software single step "
+                               "trap for %s\n",
+                               target_pid_to_str (ecs->ptid));
+
          ecs->random_signal = 0;
          /* The call to in_thread_list is necessary because PTIDs sometimes
             change when we go from single-threaded to multi-threaded.  If
@@ -1617,9 +1616,46 @@ handle_inferior_event (struct execution_control_state *ecs)
          if (!ptid_equal (singlestep_ptid, ecs->ptid)
              && in_thread_list (singlestep_ptid))
            {
-             thread_hop_needed = 1;
-             stepping_past_singlestep_breakpoint = 1;
-             saved_singlestep_ptid = singlestep_ptid;
+             /* If the PC of the thread we were trying to single-step
+                has changed, discard this event (which we were going
+                to ignore anyway), and pretend we saw that thread
+                trap.  This prevents us continuously moving the
+                single-step breakpoint forward, one instruction at a
+                time.  If the PC has changed, then the thread we were
+                trying to single-step has trapped or been signalled,
+                but the event has not been reported to GDB yet.
+
+                There might be some cases where this loses signal
+                information, if a signal has arrived at exactly the
+                same time that the PC changed, but this is the best
+                we can do with the information available.  Perhaps we
+                should arrange to report all events for all threads
+                when they stop, or to re-poll the remote looking for
+                this particular thread (i.e. temporarily enable
+                schedlock).  */
+             if (read_pc_pid (singlestep_ptid) != singlestep_pc)
+              {
+                if (debug_infrun)
+                  fprintf_unfiltered (gdb_stdlog, "infrun: unexpected thread,"
+                                      " but expected thread advanced also\n");
+
+                /* The current context still belongs to
+                   singlestep_ptid.  Don't swap here, since that's
+                   the context we want to use.  Just fudge our
+                   state and continue.  */
+                 ecs->ptid = singlestep_ptid;
+                 stop_pc = read_pc_pid (ecs->ptid);
+               }
+             else
+              {
+                if (debug_infrun)
+                  fprintf_unfiltered (gdb_stdlog,
+                                      "infrun: unexpected thread\n");
+
+                thread_hop_needed = 1;
+                stepping_past_singlestep_breakpoint = 1;
+                saved_singlestep_ptid = singlestep_ptid;
+              }
            }
        }
 
@@ -1636,7 +1672,7 @@ handle_inferior_event (struct execution_control_state *ecs)
          if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
            {
              /* Pull the single step breakpoints out of the target. */
-             SOFTWARE_SINGLE_STEP (0, 0);
+             remove_single_step_breakpoints ();
              singlestep_breakpoints_inserted_p = 0;
            }
 
@@ -1702,14 +1738,12 @@ handle_inferior_event (struct execution_control_state *ecs)
 
       if (deprecated_context_hook)
        deprecated_context_hook (pid_to_thread_id (ecs->ptid));
-
-      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);
+      remove_single_step_breakpoints ();
       singlestep_breakpoints_inserted_p = 0;
     }
 
@@ -1728,7 +1762,8 @@ handle_inferior_event (struct execution_control_state *ecs)
   /* It is far more common to need to disable a watchpoint to step
      the inferior over it.  FIXME.  What else might a debug
      register or page protection watchpoint scheme need here?  */
-  if (HAVE_NONSTEPPABLE_WATCHPOINT && STOPPED_BY_WATCHPOINT (ecs->ws))
+  if (gdbarch_have_nonsteppable_watchpoint (current_gdbarch)
+      && STOPPED_BY_WATCHPOINT (ecs->ws))
     {
       /* At this point, we are stopped at an instruction which has
          attempted to write to a piece of memory under control of
@@ -1779,7 +1814,6 @@ handle_inferior_event (struct execution_control_state *ecs)
   stop_print_frame = 1;
   ecs->random_signal = 0;
   stopped_by_random_signal = 0;
-  breakpoints_failed = 0;
 
   if (stop_signal == TARGET_SIGNAL_TRAP
       && trap_expected
@@ -1981,6 +2015,7 @@ process_event_stop_test:
             code paths as single-step - set a breakpoint at the
             signal return address and then, once hit, step off that
             breakpoint.  */
+
          insert_step_resume_breakpoint_at_frame (get_current_frame ());
          ecs->step_after_step_resume_breakpoint = 1;
          keep_going (ecs);
@@ -2041,7 +2076,8 @@ process_event_stop_test:
        disable_longjmp_breakpoint ();
        remove_breakpoints ();
        breakpoints_inserted = 0;
-       if (!GET_LONGJMP_TARGET_P () || !GET_LONGJMP_TARGET (&jmp_buf_pc))
+       if (!gdbarch_get_longjmp_target_p (current_gdbarch)
+           || !gdbarch_get_longjmp_target (current_gdbarch, &jmp_buf_pc))
          {
            keep_going (ecs);
            return;
@@ -2075,9 +2111,7 @@ process_event_stop_test:
         if (debug_infrun)
          fprintf_unfiltered (gdb_stdlog, "infrun: BPSTAT_WHAT_SINGLE\n");
        if (breakpoints_inserted)
-         {
-           remove_breakpoints ();
-         }
+         remove_breakpoints ();
        breakpoints_inserted = 0;
        ecs->another_trap = 1;
        /* Still need to check other stuff, at least the case
@@ -2147,15 +2181,6 @@ process_event_stop_test:
          }
        break;
 
-      case BPSTAT_WHAT_THROUGH_SIGTRAMP:
-        if (debug_infrun)
-         fprintf_unfiltered (gdb_stdlog, "infrun: BPSTAT_WHAT_THROUGH_SIGTRAMP\n");
-       /* If were waiting for a trap, hitting the step_resume_break
-          doesn't count as getting it.  */
-       if (trap_expected)
-         ecs->another_trap = 1;
-       break;
-
       case BPSTAT_WHAT_CHECK_SHLIBS:
       case BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK:
        {
@@ -2299,7 +2324,8 @@ process_event_stop_test:
   if (step_resume_breakpoint)
     {
       if (debug_infrun)
-        fprintf_unfiltered (gdb_stdlog, "infrun: step-resume breakpoint\n");
+        fprintf_unfiltered (gdb_stdlog,
+                            "infrun: step-resume breakpoint is inserted\n");
 
       /* Having a step-resume breakpoint overrides anything
          else having to do with stepping commands until
@@ -2432,7 +2458,7 @@ process_event_stop_test:
          end of, if we do step into it.  */
       real_stop_pc = skip_language_trampoline (stop_pc);
       if (real_stop_pc == 0)
-       real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
+       real_stop_pc = gdbarch_skip_trampoline_code (current_gdbarch, stop_pc);
       if (real_stop_pc != 0)
        ecs->stop_func_start = real_stop_pc;
 
@@ -2490,10 +2516,12 @@ process_event_stop_test:
 
   /* If we're in the return path from a shared library trampoline,
      we want to proceed through the trampoline when stepping.  */
-  if (IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
+  if (gdbarch_in_solib_return_trampoline (current_gdbarch,
+                                         stop_pc, ecs->stop_func_name))
     {
       /* Determine where this trampoline returns.  */
-      CORE_ADDR real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
+      CORE_ADDR real_stop_pc = gdbarch_skip_trampoline_code
+                                (current_gdbarch, stop_pc);
 
       if (debug_infrun)
         fprintf_unfiltered (gdb_stdlog, "infrun: stepped into solib return tramp\n");
@@ -2683,7 +2711,8 @@ step_into_function (struct execution_control_state *ecs)
 
   s = find_pc_symtab (stop_pc);
   if (s && s->language != language_asm)
-    ecs->stop_func_start = SKIP_PROLOGUE (ecs->stop_func_start);
+    ecs->stop_func_start = gdbarch_skip_prologue
+                            (current_gdbarch, ecs->stop_func_start);
 
   ecs->sal = find_pc_line (ecs->stop_func_start, 0);
   /* Use the step_resume_break to step until the end of the prologue,
@@ -2746,7 +2775,7 @@ step_into_function (struct execution_control_state *ecs)
   keep_going (ecs);
 }
 
-/* Insert a "step resume breakpoint" at SR_SAL with frame ID SR_ID.
+/* Insert a "step-resume breakpoint" at SR_SAL with frame ID SR_ID.
    This is used to both functions and to skip over code.  */
 
 static void
@@ -2757,13 +2786,19 @@ insert_step_resume_breakpoint_at_sal (struct symtab_and_line sr_sal,
      thread, so we should never be setting a new
      step_resume_breakpoint when one is already active.  */
   gdb_assert (step_resume_breakpoint == NULL);
+
+  if (debug_infrun)
+    fprintf_unfiltered (gdb_stdlog,
+                       "infrun: inserting step-resume breakpoint at 0x%s\n",
+                       paddr_nz (sr_sal.pc));
+
   step_resume_breakpoint = set_momentary_breakpoint (sr_sal, sr_id,
                                                     bp_step_resume);
   if (breakpoints_inserted)
     insert_breakpoints ();
 }
 
-/* Insert a "step resume breakpoint" at RETURN_FRAME.pc.  This is used
+/* Insert a "step-resume breakpoint" at RETURN_FRAME.pc.  This is used
    to skip a potential signal handler.
 
    This is called with the interrupted function's frame.  The signal
@@ -2777,7 +2812,8 @@ insert_step_resume_breakpoint_at_frame (struct frame_info *return_frame)
 
   init_sal (&sr_sal);          /* initialize to zeros */
 
-  sr_sal.pc = ADDR_BITS_REMOVE (get_frame_pc (return_frame));
+  sr_sal.pc = gdbarch_addr_bits_remove
+               (current_gdbarch, get_frame_pc (return_frame));
   sr_sal.section = find_pc_overlay (sr_sal.pc);
 
   insert_step_resume_breakpoint_at_sal (sr_sal, get_frame_id (return_frame));
@@ -2809,7 +2845,8 @@ insert_step_resume_breakpoint_at_caller (struct frame_info *next_frame)
 
   init_sal (&sr_sal);          /* initialize to zeros */
 
-  sr_sal.pc = ADDR_BITS_REMOVE (frame_pc_unwind (next_frame));
+  sr_sal.pc = gdbarch_addr_bits_remove
+               (current_gdbarch, frame_pc_unwind (next_frame));
   sr_sal.section = find_pc_overlay (sr_sal.pc);
 
   insert_step_resume_breakpoint_at_sal (sr_sal, frame_unwind_id (next_frame));
@@ -2858,8 +2895,9 @@ keep_going (struct execution_control_state *ecs)
 
       if (!breakpoints_inserted && !ecs->another_trap)
        {
-         breakpoints_failed = insert_breakpoints ();
-         if (breakpoints_failed)
+         /* Stop stepping when inserting breakpoints
+            has failed.  */
+         if (insert_breakpoints () != 0)
            {
              stop_stepping (ecs);
              return;
@@ -2930,10 +2968,6 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
 {
   switch (stop_reason)
     {
-    case STOP_UNKNOWN:
-      /* We don't deal with these cases from handle_inferior_event()
-         yet. */
-      break;
     case END_STEPPING_RANGE:
       /* We are done with a step/next/si/ni command. */
       /* For now print nothing. */
@@ -2945,10 +2979,6 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
            (uiout, "reason",
             async_reason_lookup (EXEC_ASYNC_END_STEPPING_RANGE));
       break;
-    case BREAKPOINT_HIT:
-      /* We found a breakpoint. */
-      /* For now print nothing. */
-      break;
     case SIGNAL_EXITED:
       /* The inferior was terminated by a signal. */
       annotate_signalled ();
@@ -3057,12 +3087,12 @@ normal_stop (void)
   /* NOTE drow/2004-01-17: Is this still necessary?  */
   /* Make sure that the current_frame's pc is correct.  This
      is a correction for setting up the frame info before doing
-     DECR_PC_AFTER_BREAK */
+     gdbarch_decr_pc_after_break */
   if (target_has_execution)
     /* FIXME: cagney/2002-12-06: Has the PC changed?  Thanks to
-       DECR_PC_AFTER_BREAK, the program counter can change.  Ask the
+       gdbarch_decr_pc_after_break, the program counter can change.  Ask the
        frame code to check for this and sort out any resultant mess.
-       DECR_PC_AFTER_BREAK needs to just go away.  */
+       gdbarch_decr_pc_after_break needs to just go away.  */
     deprecated_update_frame_pc_hack (get_current_frame (), read_pc ());
 
   if (target_has_execution && breakpoints_inserted)
@@ -3129,7 +3159,7 @@ Further execution is probably impossible.\n"));
          bpstat_print() contains the logic deciding in detail
          what to print, based on the event(s) that just occurred. */
 
-      if (stop_print_frame && deprecated_selected_frame)
+      if (stop_print_frame)
        {
          int bpstat_ret;
          int source_flag;
@@ -3163,10 +3193,6 @@ Further execution is probably impossible.\n"));
            default:
              internal_error (__FILE__, __LINE__, _("Unknown value."));
            }
-         /* For mi, have the same behavior every time we stop:
-            print everything but the source line. */
-         if (ui_out_is_mi_like_p (uiout))
-           source_flag = LOC_AND_ADDRESS;
 
          if (ui_out_is_mi_like_p (uiout))
            ui_out_field_int (uiout, "thread-id",
@@ -3648,7 +3674,7 @@ save_inferior_status (int restore_stack_info)
 
   inf_status->registers = regcache_dup (current_regcache);
 
-  inf_status->selected_frame_id = get_frame_id (deprecated_selected_frame);
+  inf_status->selected_frame_id = get_frame_id (get_selected_frame (NULL));
   return inf_status;
 }
 
This page took 0.039606 seconds and 4 git commands to generate.