mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 19:50:13 +08:00
* Makefile.in (symfile.o): Update.
* NEWS: Mention exec tracing support. * inf-ttrace.c (inf_ttrace_wait): Return TARGET_WAITKIND_EXECD for exec events. * infcmd.c (kill_if_already_running, detach_command) (disconnect_command): Replace SOLIB_RESTART with no_shared_libraries. * infrun.c (MAY_FOLLOW_EXEC, may_follow_exec): Delete. (follow_exec): Do not check may_follow_exec. Do not mourn and push targets. Apply the sysroot path to the loaded executable. Use no_shared_libraries. * linux-nat.c (linux_child_follow_fork): Print fork following messages if verbose. (kill_wait_callback): Kill again before waiting a second time. * symfile.c (symbol_file_clear): Replace SOLIB_RESTART with no_shared_libraries. * gdb.base/foll-exec.exp: Update header. Skip on remote targets. Run on GNU/Linux. (do_exec_tests): Check for systems which do not support catchpoints. Do not match START. * gdb.base/foll-fork.exp: Update header. Skip on remote targets. Run on GNU/Linux. Enable verbose output. (check_fork_catchpoints): New. (explicit_fork_child_follow, catch_fork_child_follow) (tcatch_fork_parent_follow): Update expected messages. (do_fork_tests): Use check_fork_catchpoints. * gdb.base/foll-vfork.exp: Update header. Skip on remote targets. Run on GNU/Linux. Enable verbose output. (check_vfork_catchpoints): New. (vfork_parent_follow_to_bp, tcatch_vfork_then_child_follow): Update expected messages. (do_vfork_and_exec_tests): Use check_fork_catchpoints.
This commit is contained in:
37
gdb/infrun.c
37
gdb/infrun.c
@ -105,15 +105,6 @@ int sync_execution = 0;
|
||||
|
||||
static ptid_t previous_inferior_ptid;
|
||||
|
||||
/* This is true for configurations that may follow through execl() and
|
||||
similar functions. At present this is only true for HP-UX native. */
|
||||
|
||||
#ifndef MAY_FOLLOW_EXEC
|
||||
#define MAY_FOLLOW_EXEC (0)
|
||||
#endif
|
||||
|
||||
static int may_follow_exec = MAY_FOLLOW_EXEC;
|
||||
|
||||
static int debug_infrun = 0;
|
||||
static void
|
||||
show_debug_infrun (struct ui_file *file, int from_tty,
|
||||
@ -369,9 +360,6 @@ follow_exec (int pid, char *execd_pathname)
|
||||
int saved_pid = pid;
|
||||
struct target_ops *tgt;
|
||||
|
||||
if (!may_follow_exec)
|
||||
return;
|
||||
|
||||
/* This is an exec event that we actually wish to pay attention to.
|
||||
Refresh our symbol table to the newly exec'd program, remove any
|
||||
momentary bp's, etc.
|
||||
@ -406,17 +394,20 @@ follow_exec (int pid, char *execd_pathname)
|
||||
/* We've followed the inferior through an exec. Therefore, the
|
||||
inferior has essentially been killed & reborn. */
|
||||
|
||||
/* First collect the run target in effect. */
|
||||
tgt = find_run_target ();
|
||||
/* If we can't find one, things are in a very strange state... */
|
||||
if (tgt == NULL)
|
||||
error (_("Could find run target to save before following exec"));
|
||||
|
||||
gdb_flush (gdb_stdout);
|
||||
target_mourn_inferior ();
|
||||
inferior_ptid = pid_to_ptid (saved_pid);
|
||||
generic_mourn_inferior ();
|
||||
/* Because mourn_inferior resets inferior_ptid. */
|
||||
push_target (tgt);
|
||||
inferior_ptid = pid_to_ptid (saved_pid);
|
||||
|
||||
if (gdb_sysroot && *gdb_sysroot)
|
||||
{
|
||||
char *name = alloca (strlen (gdb_sysroot)
|
||||
+ strlen (execd_pathname)
|
||||
+ 1);
|
||||
strcpy (name, gdb_sysroot);
|
||||
strcat (name, execd_pathname);
|
||||
execd_pathname = name;
|
||||
}
|
||||
|
||||
/* That a.out is now the one to use. */
|
||||
exec_file_attach (execd_pathname, 0);
|
||||
@ -427,9 +418,7 @@ follow_exec (int pid, char *execd_pathname)
|
||||
/* Reset the shared library package. This ensures that we get
|
||||
a shlib event when the child reaches "_start", at which point
|
||||
the dld will have had a chance to initialize the child. */
|
||||
#if defined(SOLIB_RESTART)
|
||||
SOLIB_RESTART ();
|
||||
#endif
|
||||
no_shared_libraries (NULL, 0);
|
||||
#ifdef SOLIB_CREATE_INFERIOR_HOOK
|
||||
SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
|
||||
#else
|
||||
|
Reference in New Issue
Block a user