aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-01-24 22:34:34 +0000
committerDaniel Jacobowitz <drow@false.org>2006-01-24 22:34:34 +0000
commit9353355fa3d730a3ffa21e35fef78cfb6475effa (patch)
treeb911676afdc03d4e71d3c113c9c190eaf71308f6 /gdb/infcmd.c
parent281b533b6ced43d45f4630a47e998ec82c42e2aa (diff)
downloadgdb-9353355fa3d730a3ffa21e35fef78cfb6475effa.zip
gdb-9353355fa3d730a3ffa21e35fef78cfb6475effa.tar.gz
gdb-9353355fa3d730a3ffa21e35fef78cfb6475effa.tar.bz2
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.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index b7d0f65..5806347 100644
--- a/gdb/infcmd.c
+++ b/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, &current_target, auto_solib_add);
-#else
- solib_add (NULL, from_tty, &current_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 (&current_target, from_tty);
+
/* Install inferior's terminal modes. */
target_terminal_inferior ();