From: Pedro Alves Date: Sun, 17 May 2009 16:31:21 +0000 (+0000) Subject: * infrun.c (pending_follow): Remove execd_pathname member. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=71b43ef89ec88b7ca60a19cf70be704555ebd348;p=binutils-gdb.git * infrun.c (pending_follow): Remove execd_pathname member. (resume): No longer handle TARGET_WAITKIND_EXECD pending follow. (handle_inferior_event): When handling a TARGET_WAITKIND_EXECD event, don't copy `execd_pathname' to pending_follow, use the event copy instead. Release `execd_pathname' once done with handling the event. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bc18ad4a996..528fbef093c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2009-05-17 Pedro Alves + + * infrun.c (pending_follow): Remove execd_pathname member. + (resume): No longer handle TARGET_WAITKIND_EXECD pending follow. + (handle_inferior_event): When handling a TARGET_WAITKIND_EXECD + event, don't copy `execd_pathname' to pending_follow, use the + event copy instead. Release `execd_pathname' once done with + handling the event. + 2009-05-17 Hui Zhu * i386-tdep.c (i386_process_record): Make it extern. diff --git a/gdb/infrun.c b/gdb/infrun.c index 903f31c6a25..526112fc073 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -268,7 +268,6 @@ static struct ptid_t child_pid; } fork_event; - char *execd_pathname; } pending_follow; @@ -1078,11 +1077,6 @@ a command like `return' or `jump' to continue execution.")); pc = regcache_read_pc (regcache); break; - case TARGET_WAITKIND_EXECD: - /* follow_exec is called as soon as the exec event is seen. */ - pending_follow.kind = TARGET_WAITKIND_SPURIOUS; - break; - default: break; } @@ -2444,9 +2438,6 @@ handle_inferior_event (struct execution_control_state *ecs) case TARGET_WAITKIND_EXECD: if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_EXECD\n"); - pending_follow.execd_pathname = - savestring (ecs->ws.value.execd_pathname, - strlen (ecs->ws.value.execd_pathname)); if (!ptid_equal (ecs->ptid, inferior_ptid)) { @@ -2459,12 +2450,16 @@ handle_inferior_event (struct execution_control_state *ecs) /* 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); + follow_exec (inferior_ptid, ecs->ws.value.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); + /* Note that this may be referenced from inside + bpstat_stop_status above, through inferior_has_execd. */ + xfree (ecs->ws.value.execd_pathname); + ecs->ws.value.execd_pathname = NULL; + /* If no catchpoint triggered for this, then keep going. */ if (ecs->random_signal) {