aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-01-08 22:52:04 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-01-08 22:52:04 +0000
commit268a4a75bdc5271819e657da07b868c8bddc500f (patch)
tree2c20316a2774bd62e6f54e6a67408e284dc41f7f /gdb/solib.c
parent339d40a3d9fe82620382abe4a4b3565d681aea11 (diff)
downloadfsf-binutils-gdb-268a4a75bdc5271819e657da07b868c8bddc500f.zip
fsf-binutils-gdb-268a4a75bdc5271819e657da07b868c8bddc500f.tar.gz
fsf-binutils-gdb-268a4a75bdc5271819e657da07b868c8bddc500f.tar.bz2
gdb/
Add from_tty to solib_create_inferior_hook. * infcmd.c (post_create_inferior): Move solib_add after solib_create_inferior_hook. Pass from_tty to solib_create_inferior_hook. Call solib_add and SOLIB_ADD with 0 from_tty and comment why. * infrun.c (follow_exec): Pass from_tty solib_create_inferior_hook as 0. * linux-nat.c (linux_child_follow_fork): Likewise. * nto-procfs.c (procfs_post_attach, procfs_create_inferior): Likewise. * solib-darwin.c (darwin_solib_create_inferior_hook): New parameter from_tty. * solib-frv.c (frv_solib_create_inferior_hook): Likewise. * solib-irix.c (irix_solib_create_inferior_hook): Likewise. * solib-null.c (null_solib_create_inferior_hook): Likewise. * solib-osf.c (osf_solib_create_inferior_hook): Likewise. * solib-pa64.c (pa64_solib_create_inferior_hook): Likewise. * solib-som.c (som_solib_create_inferior_hook): Likewise. * solib-spu.c (spu_solib_create_inferior_hook): New parameter from_tty. Pass it to svr4_so_ops.solib_create_inferior_hook. * solib-sunos.c (sunos_solib_create_inferior_hook): New parameter from_tty. * solib-svr4.c (enable_break): New parameter from_tty. Pass it to solib_add. (svr4_solib_create_inferior_hook): New parameter from_tty. Pass it to enable_break. * solib-target.c (solib_target_solib_create_inferior_hook): New parameter from_tty. * solib.c (solib_create_inferior_hook): New parameter from_tty. Pass it to ops->solib_create_inferior_hook. (reload_shared_libraries): Pass from_tty to solib_create_inferior_hook. Move solib_add after solib_create_inferior_hook, call it now with from_tty as 0. New comment there. * solib.h (solib_create_inferior_hook): New parameter from_tty. * solist.h (struct target_so_ops <solib_create_inferior_hook>): Likewise.
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index 7662e9d..6d6bf83 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1015,7 +1015,7 @@ clear_solib (void)
SYNOPSIS
- void solib_create_inferior_hook ()
+ void solib_create_inferior_hook (int from_tty)
DESCRIPTION
@@ -1025,10 +1025,10 @@ clear_solib (void)
SOLIB_CREATE_INFERIOR_HOOK. */
void
-solib_create_inferior_hook (void)
+solib_create_inferior_hook (int from_tty)
{
struct target_so_ops *ops = solib_ops (target_gdbarch);
- ops->solib_create_inferior_hook();
+ ops->solib_create_inferior_hook (from_tty);
}
/* GLOBAL FUNCTION
@@ -1104,7 +1104,6 @@ reload_shared_libraries (char *ignored, int from_tty,
struct cmd_list_element *e)
{
no_shared_libraries (NULL, from_tty);
- solib_add (NULL, from_tty, NULL, auto_solib_add);
/* Creating inferior hooks here has two purposes. First, if we reload
shared libraries then the address of solib breakpoint we've computed
previously might be no longer valid. For example, if we forgot to set
@@ -1119,9 +1118,19 @@ reload_shared_libraries (char *ignored, int from_tty,
#ifdef SOLIB_CREATE_INFERIOR_HOOK
SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
#else
- solib_create_inferior_hook ();
+ solib_create_inferior_hook (from_tty);
#endif
}
+
+ /* Sometimes the platform-specific hook loads initial shared
+ libraries, and sometimes it doesn't. If it doesn't FROM_TTY will be
+ incorrectly 0 but such solib targets should be fixed anyway. If we
+ made all the inferior hook methods consistent, this call could be
+ removed. Call it only after the solib target has been initialized by
+ solib_create_inferior_hook. */
+
+ solib_add (NULL, 0, NULL, auto_solib_add);
+
/* We have unloaded and then reloaded debug info for all shared libraries.
However, frames may still reference them, for example a frame's
unwinder might still point of DWARF FDE structures that are now freed.