summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-09-22 15:25:54 +0000
committerPedro Alves <palves@redhat.com>2008-09-22 15:25:54 +0000
commit795e548fb82c76d22dff382dfc99e121ad0f0167 (patch)
treea8e26e28975e112dcebc28d82cee9f836e33eb0e /gdb
parent54a012c9c70e6016dc5d0a0e227264f12138c57e (diff)
downloadbinutils-gdb-795e548fb82c76d22dff382dfc99e121ad0f0167.tar.gz
* infrun.c (handle_inferior_event): In the follow exec case,
context-switch before doing anything else.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/infrun.c31
2 files changed, 16 insertions, 20 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6fe342a86e0..358cca7dfff 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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.
(quit_target): Iterate over all inferiors, killing or detaching
accordingly.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 93487e3e7c4..3331152af27 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -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)
{