]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* infrun.c (handle_inferior_event): In the follow exec case,
authorPedro Alves <palves@redhat.com>
Mon, 22 Sep 2008 15:25:54 +0000 (15:25 +0000)
committerPedro Alves <palves@redhat.com>
Mon, 22 Sep 2008 15:25:54 +0000 (15:25 +0000)
context-switch before doing anything else.

gdb/ChangeLog
gdb/infrun.c

index 6fe342a86e0d9cfeee1dafc97592f5f102eea39e..358cca7dfffbd6bfa3503afe8549e8f8266bae66 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-22  Pedro Alves  <pedro@codesourcery.com>
+
+       * infrun.c (handle_inferior_event): In the follow exec case,
+       context-switch before doing anything else.
+
 2008-09-22  Pedro Alves  <pedro@codesourcery.com>
 
        * top.c (any_thread_of, kill_or_detach): New functions.
index 93487e3e7c4756dca2631ba28210b2a71c76ffa9..3331152af27f1f5bca2cb6c50e87b6465f7b1309 100644 (file)
@@ -2089,32 +2089,23 @@ handle_inferior_event (struct execution_control_state *ecs)
        savestring (ecs->ws.value.execd_pathname,
                    strlen (ecs->ws.value.execd_pathname));
 
-      /* This causes the eventpoints and symbol table to be reset.  Must
-         do this now, before trying to determine whether to stop. */
-      follow_exec (inferior_ptid, pending_follow.execd_pathname);
-      xfree (pending_follow.execd_pathname);
-
-      stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid));
-
-      {
-       /* The breakpoints module may need to touch the inferior's
-          memory.  Switch to the (stopped) event ptid
-          momentarily.  */
-       ptid_t saved_inferior_ptid = inferior_ptid;
-       inferior_ptid = ecs->ptid;
-
-       ecs->event_thread->stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
-
-       ecs->random_signal = !bpstat_explains_signal (ecs->event_thread->stop_bpstat);
-       inferior_ptid = saved_inferior_ptid;
-      }
-
       if (!ptid_equal (ecs->ptid, inferior_ptid))
        {
          context_switch (ecs->ptid);
          reinit_frame_cache ();
        }
 
+      stop_pc = read_pc ();
+
+      /* This causes the eventpoints and symbol table to be reset.
+         Must do this now, before trying to determine whether to
+         stop.  */
+      follow_exec (inferior_ptid, pending_follow.execd_pathname);
+      xfree (pending_follow.execd_pathname);
+
+      ecs->event_thread->stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
+      ecs->random_signal = !bpstat_explains_signal (ecs->event_thread->stop_bpstat);
+
       /* If no catchpoint triggered for this, then keep going.  */
       if (ecs->random_signal)
        {