+2009-05-17 Pedro Alves <pedro@codesourcery.com>
+
+ * 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 <teawater@gmail.com>
* i386-tdep.c (i386_process_record): Make it extern.
ptid_t child_pid;
}
fork_event;
- char *execd_pathname;
}
pending_follow;
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;
}
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))
{
/* 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)
{