Automatic date update in version.in
[deliverable/binutils-gdb.git] / gdb / infrun.c
index 9548f9cafdb82637cdea8c582e970a187b4a8898..05523a275630ec9cf93c46fee2f859111f47530d 100644 (file)
@@ -462,7 +462,7 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
          if (print_inferior_events)
            {
              /* Ensure that we have a process ptid.  */
-             ptid_t process_ptid = pid_to_ptid (ptid_get_pid (child_ptid));
+             ptid_t process_ptid = ptid_t (child_ptid.pid ());
 
              target_terminal::ours_for_output ();
              fprintf_filtered (gdb_stdlog,
@@ -476,7 +476,7 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
          struct inferior *parent_inf, *child_inf;
 
          /* Add process to GDB's tables.  */
-         child_inf = add_inferior (ptid_get_pid (child_ptid));
+         child_inf = add_inferior (child_ptid.pid ());
 
          parent_inf = current_inferior ();
          child_inf->attach_flag = parent_inf->attach_flag;
@@ -563,7 +563,7 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
       /* Add the new inferior first, so that the target_detach below
         doesn't unpush the target.  */
 
-      child_inf = add_inferior (ptid_get_pid (child_ptid));
+      child_inf = add_inferior (child_ptid.pid ());
 
       parent_inf = current_inferior ();
       child_inf->attach_flag = parent_inf->attach_flag;
@@ -598,7 +598,7 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
          if (print_inferior_events)
            {
              /* Ensure that we have a process ptid.  */
-             ptid_t process_ptid = pid_to_ptid (ptid_get_pid (parent_ptid));
+             ptid_t process_ptid = ptid_t (parent_ptid.pid ());
 
              target_terminal::ours_for_output ();
              fprintf_filtered (gdb_stdlog,
@@ -961,7 +961,7 @@ handle_vfork_child_exec_or_exit (int exec)
          if (print_inferior_events)
            {
              const char *pidstr
-               = target_pid_to_str (pid_to_ptid (inf->vfork_parent->pid));
+               = target_pid_to_str (ptid_t (inf->vfork_parent->pid));
 
              target_terminal::ours_for_output ();
 
@@ -1082,7 +1082,7 @@ follow_exec (ptid_t ptid, char *exec_file_target)
 {
   struct thread_info *th, *tmp;
   struct inferior *inf = current_inferior ();
-  int pid = ptid_get_pid (ptid);
+  int pid = ptid.pid ();
   ptid_t process_ptid;
 
   /* This is an exec event that we actually wish to pay attention to.
@@ -1128,7 +1128,7 @@ follow_exec (ptid_t ptid, char *exec_file_target)
      stop provides a nicer sequence of events for user and MI
      notifications.  */
   ALL_THREADS_SAFE (th, tmp)
-    if (ptid_get_pid (th->ptid) == pid && !ptid_equal (th->ptid, ptid))
+    if (th->ptid.pid () == pid && th->ptid != ptid)
       delete_thread (th);
 
   /* We also need to clear any left over stale state for the
@@ -1150,7 +1150,7 @@ follow_exec (ptid_t ptid, char *exec_file_target)
   update_breakpoints_after_exec ();
 
   /* What is this a.out's name?  */
-  process_ptid = pid_to_ptid (pid);
+  process_ptid = ptid_t (pid);
   printf_unfiltered (_("%s is executing new program: %s\n"),
                     target_pid_to_str (process_ptid),
                     exec_file_target);
@@ -1190,7 +1190,7 @@ follow_exec (ptid_t ptid, char *exec_file_target)
       /* Do exit processing for the original inferior before adding
         the new inferior so we don't have two active inferiors with
         the same ptid, which can confuse find_inferior_ptid.  */
-      exit_inferior_num_silent (current_inferior ()->num);
+      exit_inferior_silent (current_inferior ());
 
       inf = add_inferior_with_spaces ();
       inf->pid = pid;
@@ -2174,9 +2174,7 @@ start_step_over (void)
 static void
 infrun_thread_ptid_changed (ptid_t old_ptid, ptid_t new_ptid)
 {
-  struct displaced_step_inferior_state *displaced;
-
-  if (ptid_equal (inferior_ptid, old_ptid))
+  if (inferior_ptid == old_ptid)
     inferior_ptid = new_ptid;
 }
 
@@ -2268,7 +2266,7 @@ user_visible_resume_ptid (int step)
     {
       /* Resume all threads of the current process (and none of other
         processes).  */
-      resume_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
+      resume_ptid = ptid_t (inferior_ptid.pid ());
     }
   else
     {
@@ -2877,13 +2875,13 @@ clear_proceed_status (int step)
         we're about to resume, implicitly and explicitly.  */
       ALL_NON_EXITED_THREADS (tp)
         {
-         if (!ptid_match (tp->ptid, resume_ptid))
+         if (!tp->ptid.matches (resume_ptid))
            continue;
          clear_proceed_status_thread (tp);
        }
     }
 
-  if (!ptid_equal (inferior_ptid, null_ptid))
+  if (inferior_ptid != null_ptid)
     {
       struct inferior *inferior;
 
@@ -3009,7 +3007,7 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal)
 
   if (addr == (CORE_ADDR) -1)
     {
-      if (pc == stop_pc
+      if (pc == tp->suspend.stop_pc
          && breakpoint_here_p (aspace, pc) == ordinary_breakpoint_here
          && execution_direction != EXEC_REVERSE)
        /* There is a breakpoint at the address we will resume at,
@@ -3095,7 +3093,7 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal)
            continue;
 
          /* Ignore threads of processes we're not resuming.  */
-         if (!ptid_match (tp->ptid, resume_ptid))
+         if (!tp->ptid.matches (resume_ptid))
            continue;
 
          if (!thread_still_needs_step_over (tp))
@@ -3149,7 +3147,7 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal)
        ALL_NON_EXITED_THREADS (tp)
         {
          /* Ignore threads of processes we're not resuming.  */
-         if (!ptid_match (tp->ptid, resume_ptid))
+         if (!tp->ptid.matches (resume_ptid))
            continue;
 
          if (tp->resumed)
@@ -3291,7 +3289,7 @@ infrun_thread_stop_requested (ptid_t ptid)
      thread had been temporarily paused for some step-over), set up
      for reporting the stop now.  */
   ALL_NON_EXITED_THREADS (tp)
-    if (ptid_match (tp->ptid, ptid))
+    if (tp->ptid.matches (ptid))
       {
        if (tp->state != THREAD_RUNNING)
          continue;
@@ -3336,7 +3334,7 @@ infrun_thread_stop_requested (ptid_t ptid)
 static void
 infrun_thread_thread_exit (struct thread_info *tp, int silent)
 {
-  if (ptid_equal (target_last_wait_ptid, tp->ptid))
+  if (target_last_wait_ptid == tp->ptid)
     nullify_last_target_wait_ptid ();
 }
 
@@ -3361,7 +3359,7 @@ typedef void (*for_each_just_stopped_thread_callback_func)
 static void
 for_each_just_stopped_thread (for_each_just_stopped_thread_callback_func func)
 {
-  if (!target_has_execution || ptid_equal (inferior_ptid, null_ptid))
+  if (!target_has_execution || inferior_ptid == null_ptid)
     return;
 
   if (target_is_non_stop_p ())
@@ -3422,16 +3420,16 @@ print_target_wait_results (ptid_t waiton_ptid, ptid_t result_ptid,
      is set.  */
 
   stb.printf ("infrun: target_wait (%d.%ld.%ld",
-             ptid_get_pid (waiton_ptid),
-             ptid_get_lwp (waiton_ptid),
-             ptid_get_tid (waiton_ptid));
-  if (ptid_get_pid (waiton_ptid) != -1)
+             waiton_ptid.pid (),
+             waiton_ptid.lwp (),
+             waiton_ptid.tid ());
+  if (waiton_ptid.pid () != -1)
     stb.printf (" [%s]", target_pid_to_str (waiton_ptid));
   stb.printf (", status) =\n");
   stb.printf ("infrun:   %d.%ld.%ld [%s],\n",
-             ptid_get_pid (result_ptid),
-             ptid_get_lwp (result_ptid),
-             ptid_get_tid (result_ptid),
+             result_ptid.pid (),
+             result_ptid.lwp (),
+             result_ptid.tid (),
              target_pid_to_str (result_ptid));
   stb.printf ("infrun:   %s\n", status_string.c_str ());
 
@@ -3453,7 +3451,7 @@ random_pending_event_thread (ptid_t waiton_ptid)
   /* First see how many events we have.  Count only resumed threads
      that have an event pending.  */
   ALL_NON_EXITED_THREADS (event_tp)
-    if (ptid_match (event_tp->ptid, waiton_ptid)
+    if (event_tp->ptid.matches (waiton_ptid)
        && event_tp->resumed
        && event_tp->suspend.waitstatus_pending_p)
       num_events++;
@@ -3472,7 +3470,7 @@ random_pending_event_thread (ptid_t waiton_ptid)
 
   /* Select the Nth thread that has had an event.  */
   ALL_NON_EXITED_THREADS (event_tp)
-    if (ptid_match (event_tp->ptid, waiton_ptid)
+    if (event_tp->ptid.matches (waiton_ptid)
        && event_tp->resumed
        && event_tp->suspend.waitstatus_pending_p)
       if (random_selector-- == 0)
@@ -3493,7 +3491,7 @@ do_target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
 
   /* First check if there is a resumed thread with a wait status
      pending.  */
-  if (ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid))
+  if (ptid == minus_one_ptid || ptid.is_pid ())
     {
       tp = random_pending_event_thread (ptid);
     }
@@ -3621,7 +3619,7 @@ void
 prepare_for_detach (void)
 {
   struct inferior *inf = current_inferior ();
-  ptid_t pid_ptid = pid_to_ptid (inf->pid);
+  ptid_t pid_ptid = ptid_t (inf->pid);
 
   displaced_step_inferior_state *displaced = get_displaced_stepping_state (inf);
 
@@ -4249,7 +4247,7 @@ handle_syscall_event (struct execution_control_state *ecs)
 
   regcache = get_thread_regcache (ecs->event_thread);
   syscall_number = ecs->ws.value.syscall_number;
-  stop_pc = regcache_read_pc (regcache);
+  ecs->event_thread->suspend.stop_pc = regcache_read_pc (regcache);
 
   if (catch_syscall_enabled () > 0
       && catching_syscall_number (syscall_number) > 0)
@@ -4260,7 +4258,8 @@ handle_syscall_event (struct execution_control_state *ecs)
 
       ecs->event_thread->control.stop_bpstat
        = bpstat_stop_status (regcache->aspace (),
-                             stop_pc, ecs->event_thread, &ecs->ws);
+                             ecs->event_thread->suspend.stop_pc,
+                             ecs->event_thread, &ecs->ws);
 
       if (handle_stop_requested (ecs))
        return 0;
@@ -4290,7 +4289,8 @@ fill_in_stop_func (struct gdbarch *gdbarch,
     {
       /* Don't care about return value; stop_func_start and stop_func_name
         will both be 0 if it doesn't work.  */
-      find_pc_partial_function (stop_pc, &ecs->stop_func_name,
+      find_pc_partial_function (ecs->event_thread->suspend.stop_pc,
+                               &ecs->stop_func_name,
                                &ecs->stop_func_start, &ecs->stop_func_end);
       ecs->stop_func_start
        += gdbarch_deprecated_function_start_offset (gdbarch);
@@ -4374,9 +4374,9 @@ save_waitstatus (struct thread_info *tp, struct target_waitstatus *ws)
       fprintf_unfiltered (gdb_stdlog,
                          "infrun: saving status %s for %d.%ld.%ld\n",
                          statstr.c_str (),
-                         ptid_get_pid (tp->ptid),
-                         ptid_get_lwp (tp->ptid),
-                         ptid_get_tid (tp->ptid));
+                         tp->ptid.pid (),
+                         tp->ptid.lwp (),
+                         tp->ptid.tid ());
     }
 
   /* Record for later.  */
@@ -4545,7 +4545,7 @@ stop_all_threads (void)
            {
              if (debug_infrun)
                {
-                 ptid_t ptid = pid_to_ptid (ws.value.integer);
+                 ptid_t ptid = ptid_t (ws.value.integer);
 
                  fprintf_unfiltered (gdb_stdlog,
                                      "infrun: %s exited while "
@@ -4611,9 +4611,9 @@ stop_all_threads (void)
                                          "infrun: target_wait %s, saving "
                                          "status for %d.%ld.%ld\n",
                                          statstr.c_str (),
-                                         ptid_get_pid (t->ptid),
-                                         ptid_get_lwp (t->ptid),
-                                         ptid_get_tid (t->ptid));
+                                         t->ptid.pid (),
+                                         t->ptid.lwp (),
+                                         t->ptid.tid ());
                    }
 
                  /* Record for later.  */
@@ -4902,7 +4902,7 @@ handle_inferior_event_1 (struct execution_control_state *ecs)
           process as not-executing so that finish_thread_state marks
           them stopped (in the user's perspective) if/when we present
           the stop to the user.  */
-       mark_ptid = pid_to_ptid (ptid_get_pid (ecs->ptid));
+       mark_ptid = ptid_t (ecs->ptid.pid ());
       }
     else
       mark_ptid = ecs->ptid;
@@ -4937,7 +4937,8 @@ handle_inferior_event_1 (struct execution_control_state *ecs)
 
          ecs->event_thread->control.stop_bpstat
            = bpstat_stop_status (regcache->aspace (),
-                                 stop_pc, ecs->event_thread, &ecs->ws);
+                                 ecs->event_thread->suspend.stop_pc,
+                                 ecs->event_thread, &ecs->ws);
 
          if (handle_stop_requested (ecs))
            return;
@@ -5183,11 +5184,13 @@ Cannot fill $_exitsignal with the correct signal number.\n"));
         and not immediately.  */
       ecs->event_thread->pending_follow = ecs->ws;
 
-      stop_pc = regcache_read_pc (get_thread_regcache (ecs->event_thread));
+      ecs->event_thread->suspend.stop_pc
+       = regcache_read_pc (get_thread_regcache (ecs->event_thread));
 
       ecs->event_thread->control.stop_bpstat
        = bpstat_stop_status (get_current_regcache ()->aspace (),
-                             stop_pc, ecs->event_thread, &ecs->ws);
+                             ecs->event_thread->suspend.stop_pc,
+                             ecs->event_thread, &ecs->ws);
 
       if (handle_stop_requested (ecs))
        return;
@@ -5289,16 +5292,18 @@ Cannot fill $_exitsignal with the correct signal number.\n"));
          stop.  */
       follow_exec (inferior_ptid, ecs->ws.value.execd_pathname);
 
-      stop_pc = regcache_read_pc (get_thread_regcache (ecs->event_thread));
-
       /* In follow_exec we may have deleted the original thread and
         created a new one.  Make sure that the event thread is the
         execd thread for that case (this is a nop otherwise).  */
       ecs->event_thread = inferior_thread ();
 
+      ecs->event_thread->suspend.stop_pc
+       = regcache_read_pc (get_thread_regcache (ecs->event_thread));
+
       ecs->event_thread->control.stop_bpstat
        = bpstat_stop_status (get_current_regcache ()->aspace (),
-                             stop_pc, ecs->event_thread, &ecs->ws);
+                             ecs->event_thread->suspend.stop_pc,
+                             ecs->event_thread, &ecs->ws);
 
       /* Note that this may be referenced from inside
         bpstat_stop_status above, through inferior_has_execd.  */
@@ -5359,7 +5364,8 @@ Cannot fill $_exitsignal with the correct signal number.\n"));
        fprintf_unfiltered (gdb_stdlog, "infrun: stopped\n");
 
       delete_just_stopped_threads_single_step_breakpoints ();
-      stop_pc = regcache_read_pc (get_thread_regcache (inferior_thread ()));
+      ecs->event_thread->suspend.stop_pc
+       = regcache_read_pc (get_thread_regcache (inferior_thread ()));
 
       if (handle_stop_requested (ecs))
        return;
@@ -5651,7 +5657,8 @@ handle_signal_stop (struct execution_control_state *ecs)
       && ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP)
     ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
 
-  stop_pc = regcache_read_pc (get_thread_regcache (ecs->event_thread));
+  ecs->event_thread->suspend.stop_pc
+    = regcache_read_pc (get_thread_regcache (ecs->event_thread));
 
   if (debug_infrun)
     {
@@ -5662,7 +5669,8 @@ handle_signal_stop (struct execution_control_state *ecs)
       inferior_ptid = ecs->ptid;
 
       fprintf_unfiltered (gdb_stdlog, "infrun: stop_pc = %s\n",
-                          paddress (gdbarch, stop_pc));
+                         paddress (gdbarch,
+                                   ecs->event_thread->suspend.stop_pc));
       if (target_stopped_by_watchpoint ())
        {
           CORE_ADDR addr;
@@ -5725,7 +5733,7 @@ handle_signal_stop (struct execution_control_state *ecs)
 
   /* See if something interesting happened to the non-current thread.  If
      so, then switch to that thread.  */
-  if (!ptid_equal (ecs->ptid, inferior_ptid))
+  if (ecs->ptid != inferior_ptid)
     {
       if (debug_infrun)
        fprintf_unfiltered (gdb_stdlog, "infrun: context switch\n");
@@ -5858,14 +5866,18 @@ handle_signal_stop (struct execution_control_state *ecs)
         user had set a breakpoint on that inlined code, the missing
         skip_inline_frames call would break things.  Fortunately
         that's an extremely unlikely scenario.  */
-      if (!pc_at_non_inline_function (aspace, stop_pc, &ecs->ws)
+      if (!pc_at_non_inline_function (aspace,
+                                     ecs->event_thread->suspend.stop_pc,
+                                     &ecs->ws)
          && !(ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP
               && ecs->event_thread->control.trap_expected
               && pc_at_non_inline_function (aspace,
                                             ecs->event_thread->prev_pc,
                                             &ecs->ws)))
        {
-         stop_chain = build_bpstat_chain (aspace, stop_pc, &ecs->ws);
+         stop_chain = build_bpstat_chain (aspace,
+                                          ecs->event_thread->suspend.stop_pc,
+                                          &ecs->ws);
          skip_inline_frames (ecs->event_thread, stop_chain);
 
          /* Re-fetch current thread's frame in case that invalidated
@@ -5915,7 +5927,8 @@ handle_signal_stop (struct execution_control_state *ecs)
      handles this event.  */
   ecs->event_thread->control.stop_bpstat
     = bpstat_stop_status (get_current_regcache ()->aspace (),
-                         stop_pc, ecs->event_thread, &ecs->ws, stop_chain);
+                         ecs->event_thread->suspend.stop_pc,
+                         ecs->event_thread, &ecs->ws, stop_chain);
 
   /* Following in case break condition called a
      function.  */
@@ -5967,7 +5980,8 @@ handle_signal_stop (struct execution_control_state *ecs)
      been removed.  */
   if (random_signal && target_stopped_by_sw_breakpoint ())
     {
-      if (program_breakpoint_here_p (gdbarch, stop_pc))
+      if (program_breakpoint_here_p (gdbarch,
+                                    ecs->event_thread->suspend.stop_pc))
        {
          struct regcache *regcache;
          int decr_pc;
@@ -5985,7 +5999,8 @@ handle_signal_stop (struct execution_control_state *ecs)
                restore_operation_disable.emplace
                  (record_full_gdb_operation_disable_set ());
 
-             regcache_write_pc (regcache, stop_pc + decr_pc);
+             regcache_write_pc (regcache,
+                                ecs->event_thread->suspend.stop_pc + decr_pc);
            }
        }
       else
@@ -6077,7 +6092,7 @@ handle_signal_stop (struct execution_control_state *ecs)
       if (signal_program[ecs->event_thread->suspend.stop_signal] == 0)
        ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
 
-      if (ecs->event_thread->prev_pc == stop_pc
+      if (ecs->event_thread->prev_pc == ecs->event_thread->suspend.stop_pc
          && ecs->event_thread->control.trap_expected
          && ecs->event_thread->control.step_resume_breakpoint == NULL)
        {
@@ -6109,7 +6124,8 @@ handle_signal_stop (struct execution_control_state *ecs)
        }
 
       if (ecs->event_thread->suspend.stop_signal != GDB_SIGNAL_0
-         && (pc_in_thread_step_range (stop_pc, ecs->event_thread)
+         && (pc_in_thread_step_range (ecs->event_thread->suspend.stop_pc,
+                                      ecs->event_thread)
              || ecs->event_thread->control.step_range_end == 1)
          && frame_id_eq (get_stack_frame_id (frame),
                          ecs->event_thread->control.step_stack_frame_id)
@@ -6339,7 +6355,7 @@ process_event_stop_test (struct execution_control_state *ecs)
          return;
        }
       fill_in_stop_func (gdbarch, ecs);
-      if (stop_pc == ecs->stop_func_start
+      if (ecs->event_thread->suspend.stop_pc == ecs->stop_func_start
          && execution_direction == EXEC_REVERSE)
        {
          /* We are stepping over a function call in reverse, and just
@@ -6472,7 +6488,8 @@ process_event_stop_test (struct execution_control_state *ecs)
      through a function epilogue and therefore must detect when
      the current-frame changes in the middle of a line.  */
 
-  if (pc_in_thread_step_range (stop_pc, ecs->event_thread)
+  if (pc_in_thread_step_range (ecs->event_thread->suspend.stop_pc,
+                              ecs->event_thread)
       && (execution_direction != EXEC_REVERSE
          || frame_id_eq (get_frame_id (frame),
                          ecs->event_thread->control.step_frame_id)))
@@ -6491,6 +6508,7 @@ process_event_stop_test (struct execution_control_state *ecs)
       /* When stepping backward, stop at beginning of line range
         (unless it's the function entry point, in which case
         keep going back to the call point).  */
+      CORE_ADDR stop_pc = ecs->event_thread->suspend.stop_pc;
       if (stop_pc == ecs->event_thread->control.step_range_start
          && stop_pc != ecs->stop_func_start
          && execution_direction == EXEC_REVERSE)
@@ -6517,10 +6535,11 @@ process_event_stop_test (struct execution_control_state *ecs)
 
   if (execution_direction != EXEC_REVERSE
       && ecs->event_thread->control.step_over_calls == STEP_OVER_UNDEBUGGABLE
-      && in_solib_dynsym_resolve_code (stop_pc))
+      && in_solib_dynsym_resolve_code (ecs->event_thread->suspend.stop_pc))
     {
       CORE_ADDR pc_after_resolver =
-       gdbarch_skip_solib_resolver (gdbarch, stop_pc);
+       gdbarch_skip_solib_resolver (gdbarch,
+                                    ecs->event_thread->suspend.stop_pc);
 
       if (debug_infrun)
         fprintf_unfiltered (gdb_stdlog,
@@ -6544,7 +6563,8 @@ process_event_stop_test (struct execution_control_state *ecs)
 
   /* Step through an indirect branch thunk.  */
   if (ecs->event_thread->control.step_over_calls != STEP_OVER_NONE
-      && gdbarch_in_indirect_branch_thunk (gdbarch, stop_pc))
+      && gdbarch_in_indirect_branch_thunk (gdbarch,
+                                          ecs->event_thread->suspend.stop_pc))
     {
       if (debug_infrun)
         fprintf_unfiltered (gdb_stdlog,
@@ -6576,13 +6596,14 @@ process_event_stop_test (struct execution_control_state *ecs)
      call check below as on some targets return trampolines look
      like subroutine calls (MIPS16 return thunks).  */
   if (gdbarch_in_solib_return_trampoline (gdbarch,
-                                         stop_pc, ecs->stop_func_name)
+                                         ecs->event_thread->suspend.stop_pc,
+                                         ecs->stop_func_name)
       && ecs->event_thread->control.step_over_calls != STEP_OVER_NONE)
     {
       /* Determine where this trampoline returns.  */
-      CORE_ADDR real_stop_pc;
-
-      real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc);
+      CORE_ADDR stop_pc = ecs->event_thread->suspend.stop_pc;
+      CORE_ADDR real_stop_pc
+       = gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc);
 
       if (debug_infrun)
         fprintf_unfiltered (gdb_stdlog,
@@ -6634,8 +6655,9 @@ process_event_stop_test (struct execution_control_state *ecs)
          && (!frame_id_eq (ecs->event_thread->control.step_stack_frame_id,
                            outer_frame_id)
              || (ecs->event_thread->control.step_start_function
-                 != find_pc_function (stop_pc)))))
+                 != find_pc_function (ecs->event_thread->suspend.stop_pc)))))
     {
+      CORE_ADDR stop_pc = ecs->event_thread->suspend.stop_pc;
       CORE_ADDR real_stop_pc;
 
       if (debug_infrun)
@@ -6793,6 +6815,8 @@ process_event_stop_test (struct execution_control_state *ecs)
   if (execution_direction == EXEC_REVERSE
       && ecs->event_thread->control.step_over_calls != STEP_OVER_NONE)
     {
+      CORE_ADDR stop_pc = ecs->event_thread->suspend.stop_pc;
+
       if (gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc)
          || (ecs->stop_func_start == 0
              && in_solib_dynsym_resolve_code (stop_pc)))
@@ -6820,7 +6844,7 @@ process_event_stop_test (struct execution_control_state *ecs)
        }
     }
 
-  stop_pc_sal = find_pc_line (stop_pc, 0);
+  stop_pc_sal = find_pc_line (ecs->event_thread->suspend.stop_pc, 0);
 
   /* NOTE: tausq/2004-05-24: This if block used to be done before all
      the trampoline processing logic, however, there are some trampolines 
@@ -6946,7 +6970,7 @@ process_event_stop_test (struct execution_control_state *ecs)
       return;
     }
 
-  if ((stop_pc == stop_pc_sal.pc)
+  if ((ecs->event_thread->suspend.stop_pc == stop_pc_sal.pc)
       && (ecs->event_thread->current_line != stop_pc_sal.line
          || ecs->event_thread->current_symtab != stop_pc_sal.symtab))
     {
@@ -7080,7 +7104,7 @@ switch_back_to_stepped_thread (struct execution_control_state *ecs)
          /* Ignore threads of processes the caller is not
             resuming.  */
          if (!sched_multi
-             && ptid_get_pid (tp->ptid) != ptid_get_pid (ecs->ptid))
+             && tp->ptid.pid () != ecs->ptid.pid ())
            continue;
 
          /* When stepping over a breakpoint, we lock all threads
@@ -7180,7 +7204,7 @@ keep_going_stepped_thread (struct thread_info *tp)
   reset_ecs (ecs, tp);
   switch_to_thread (tp);
 
-  stop_pc = regcache_read_pc (get_thread_regcache (tp));
+  tp->suspend.stop_pc = regcache_read_pc (get_thread_regcache (tp));
   frame = get_current_frame ();
 
   /* If the PC of the thread we were trying to single-step has
@@ -7196,7 +7220,7 @@ keep_going_stepped_thread (struct thread_info *tp)
      This prevents us continuously moving the single-step breakpoint
      forward, one instruction at a time, overstepping.  */
 
-  if (stop_pc != tp->prev_pc)
+  if (tp->suspend.stop_pc != tp->prev_pc)
     {
       ptid_t resume_ptid;
 
@@ -7204,7 +7228,7 @@ keep_going_stepped_thread (struct thread_info *tp)
        fprintf_unfiltered (gdb_stdlog,
                            "infrun: expected thread advanced also (%s -> %s)\n",
                            paddress (target_gdbarch (), tp->prev_pc),
-                           paddress (target_gdbarch (), stop_pc));
+                           paddress (target_gdbarch (), tp->suspend.stop_pc));
 
       /* Clear the info of the previous step-over, as it's no longer
         valid (if the thread was trying to step over a breakpoint, it
@@ -7218,7 +7242,7 @@ keep_going_stepped_thread (struct thread_info *tp)
 
       insert_single_step_breakpoint (get_frame_arch (frame),
                                     get_frame_address_space (frame),
-                                    stop_pc);
+                                    tp->suspend.stop_pc);
 
       tp->resumed = 1;
       resume_ptid = internal_resume_ptid (tp->control.stepping_command);
@@ -7259,7 +7283,8 @@ handle_step_into_function (struct gdbarch *gdbarch,
 {
   fill_in_stop_func (gdbarch, ecs);
 
-  compunit_symtab *cust = find_pc_compunit_symtab (stop_pc);
+  compunit_symtab *cust
+    = find_pc_compunit_symtab (ecs->event_thread->suspend.stop_pc);
   if (cust != NULL && compunit_language (cust) != language_asm)
     ecs->stop_func_start
       = gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start);
@@ -7299,7 +7324,7 @@ handle_step_into_function (struct gdbarch *gdbarch,
                                             ecs->stop_func_start);
     }
 
-  if (ecs->stop_func_start == stop_pc)
+  if (ecs->stop_func_start == ecs->event_thread->suspend.stop_pc)
     {
       /* We are already there: stop now.  */
       end_stepping_range (ecs);
@@ -7338,15 +7363,15 @@ handle_step_into_function_backward (struct gdbarch *gdbarch,
 
   fill_in_stop_func (gdbarch, ecs);
 
-  cust = find_pc_compunit_symtab (stop_pc);
+  cust = find_pc_compunit_symtab (ecs->event_thread->suspend.stop_pc);
   if (cust != NULL && compunit_language (cust) != language_asm)
     ecs->stop_func_start
       = gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start);
 
-  stop_func_sal = find_pc_line (stop_pc, 0);
+  stop_func_sal = find_pc_line (ecs->event_thread->suspend.stop_pc, 0);
 
   /* OK, we're just going to keep stepping here.  */
-  if (stop_func_sal.pc == stop_pc)
+  if (stop_func_sal.pc == ecs->event_thread->suspend.stop_pc)
     {
       /* We're there already.  Just stop stepping now.  */
       end_stepping_range (ecs);
@@ -7646,7 +7671,7 @@ stop_waiting (struct execution_control_state *ecs)
 static void
 keep_going_pass_signal (struct execution_control_state *ecs)
 {
-  gdb_assert (ptid_equal (ecs->event_thread->ptid, inferior_ptid));
+  gdb_assert (ecs->event_thread->ptid == inferior_ptid);
   gdb_assert (!ecs->event_thread->resumed);
 
   /* Save the pc before execution, to compare with pc after stop.  */
@@ -7860,7 +7885,7 @@ void
 print_exited_reason (struct ui_out *uiout, int exitstatus)
 {
   struct inferior *inf = current_inferior ();
-  const char *pidstr = target_pid_to_str (pid_to_ptid (inf->pid));
+  const char *pidstr = target_pid_to_str (ptid_t (inf->pid));
 
   annotate_exited (exitstatus);
   if (exitstatus)
@@ -7981,7 +8006,8 @@ print_stop_location (struct target_waitstatus *ws)
       if (tp->control.stop_step
          && frame_id_eq (tp->control.step_frame_id,
                          get_frame_id (get_current_frame ()))
-         && tp->control.step_start_function == find_pc_function (stop_pc))
+         && (tp->control.step_start_function
+             == find_pc_function (tp->suspend.stop_pc)))
        {
          /* Finished step, just print source line.  */
          source_flag = SRC_LINE;
@@ -8097,7 +8123,7 @@ save_stop_context (void)
   sc->ptid = inferior_ptid;
   sc->inf_num = current_inferior ()->num;
 
-  if (!ptid_equal (inferior_ptid, null_ptid))
+  if (inferior_ptid != null_ptid)
     {
       /* Take a strong reference so that the thread can't be deleted
         yet.  */
@@ -8129,7 +8155,7 @@ release_stop_context_cleanup (void *arg)
 static int
 stop_context_changed (struct stop_context *prev)
 {
-  if (!ptid_equal (prev->ptid, inferior_ptid))
+  if (prev->ptid != inferior_ptid)
     return 1;
   if (prev->inf_num != current_inferior ()->num)
     return 1;
@@ -8310,7 +8336,7 @@ normal_stop (void)
 
   /* Notify observers about the stop.  This is where the interpreters
      print the stop event.  */
-  if (!ptid_equal (inferior_ptid, null_ptid))
+  if (inferior_ptid != null_ptid)
     gdb::observers::normal_stop.notify (inferior_thread ()->control.stop_bpstat,
                                 stop_print_frame);
   else
@@ -8762,7 +8788,7 @@ siginfo_make_value (struct gdbarch *gdbarch, struct internalvar *var,
                    void *ignore)
 {
   if (target_has_stack
-      && !ptid_equal (inferior_ptid, null_ptid)
+      && inferior_ptid != null_ptid
       && gdbarch_get_siginfo_type_p (gdbarch))
     {
       struct type *type = gdbarch_get_siginfo_type (gdbarch);
@@ -8785,7 +8811,6 @@ struct infcall_suspend_state
   struct thread_suspend_state thread_suspend;
 
   /* Other fields:  */
-  CORE_ADDR stop_pc;
   readonly_detached_regcache *registers;
 
   /* Format of SIGINFO_DATA or NULL if it is not present.  */
@@ -8840,8 +8865,6 @@ save_infcall_suspend_state (void)
      GDB_SIGNAL_0 anyway.  */
   tp->suspend.stop_signal = GDB_SIGNAL_0;
 
-  inf_state->stop_pc = stop_pc;
-
   inf_state->registers = new readonly_detached_regcache (*regcache);
 
   return inf_state;
@@ -8858,8 +8881,6 @@ restore_infcall_suspend_state (struct infcall_suspend_state *inf_state)
 
   tp->suspend = inf_state->thread_suspend;
 
-  stop_pc = inf_state->stop_pc;
-
   if (inf_state->siginfo_gdbarch == gdbarch)
     {
       struct type *type = gdbarch_get_siginfo_type (gdbarch);
This page took 0.036647 seconds and 4 git commands to generate.