forked from Imagelibrary/binutils-gdb
PR gdb/1914
* fork-child.c (fork_inferior): Don't call solib_create_inferior_hook. * infcmd.c (post_create_inferior): Call solib_add, solib_create_inferior_hook, and re_enable_breakpoints_in_shlibs. (attach_command): Don't call solib_add or re_enable_breakpoints_in_shlibs. Call post_create_inferior instead. * remote.c (remote_open_1): Don't call solib_create_inferior_hook or observer_notify_inferior_created. Call post_create_inferior instead. * corelow.c: Don't include "observer.h". (solib_add_stub): Deleted. (core_open): Don't call observer_notify_inferior_created or solib_add_stub. Call post_create_inferior instead. * inf-ptrace.c: Don't include "observer.h". (inf_ptrace_attach): Don't call observer_notify_inferior_created. * inf-ttrace.c: Don't include "observer.h". (inf_ttrace_attach): Don't call observer_notify_inferior_created. * inferior.h (solib_create_inferior_hook): Remove redundant prototype. * inftarg.c: Don't include "observer.h". (child_attach): Don't call observer_notify_inferior_created. * Makefile.in: Update dependencies.
This commit is contained in:
34
gdb/infcmd.c
34
gdb/infcmd.c
@@ -405,6 +405,30 @@ tty_command (char *file, int from_tty)
|
||||
void
|
||||
post_create_inferior (struct target_ops *target, int from_tty)
|
||||
{
|
||||
if (exec_bfd)
|
||||
{
|
||||
/* Sometimes the platform-specific hook loads initial shared
|
||||
libraries, and sometimes it doesn't. Try to do so first, so
|
||||
that we can add them with the correct value for FROM_TTY. */
|
||||
#ifdef SOLIB_ADD
|
||||
SOLIB_ADD (NULL, from_tty, target, auto_solib_add);
|
||||
#else
|
||||
solib_add (NULL, from_tty, target, auto_solib_add);
|
||||
#endif
|
||||
|
||||
/* Create the hooks to handle shared library load and unload
|
||||
events. */
|
||||
#ifdef SOLIB_CREATE_INFERIOR_HOOK
|
||||
SOLIB_CREATE_INFERIOR_HOOK (pid);
|
||||
#else
|
||||
solib_create_inferior_hook ();
|
||||
#endif
|
||||
|
||||
/* Enable any breakpoints which were disabled when the
|
||||
underlying shared library was deleted. */
|
||||
re_enable_breakpoints_in_shlibs ();
|
||||
}
|
||||
|
||||
observer_notify_inferior_created (target, from_tty);
|
||||
}
|
||||
|
||||
@@ -1899,18 +1923,12 @@ attach_command (char *args, int from_tty)
|
||||
reread_symbols ();
|
||||
}
|
||||
|
||||
#ifdef SOLIB_ADD
|
||||
/* Add shared library symbols from the newly attached process, if any. */
|
||||
SOLIB_ADD ((char *) 0, from_tty, ¤t_target, auto_solib_add);
|
||||
#else
|
||||
solib_add (NULL, from_tty, ¤t_target, auto_solib_add);
|
||||
#endif
|
||||
re_enable_breakpoints_in_shlibs ();
|
||||
|
||||
/* Take any necessary post-attaching actions for this platform.
|
||||
*/
|
||||
target_post_attach (PIDGET (inferior_ptid));
|
||||
|
||||
post_create_inferior (¤t_target, from_tty);
|
||||
|
||||
/* Install inferior's terminal modes. */
|
||||
target_terminal_inferior ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user