diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 81fae4924a5..417c563849a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-06-28 Pedro Alves + + * infrun.c (handle_inferior_event_1) : + Moving fetching stop_pc until after ecs->event_thread is refreshed. + 2018-06-28 Tom Tromey * coffread.c (coff_symfile_finish): Update. diff --git a/gdb/infrun.c b/gdb/infrun.c index 9548f9cafdb..4c732340d1e 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -5289,13 +5289,13 @@ 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 (); + 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);