aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2009-03-09 13:19:19 +0000
committerVladimir Prus <vladimir@codesourcery.com>2009-03-09 13:19:19 +0000
commitc8fa6cdda407a09ab5bd2999a8fe6468b2690fb0 (patch)
tree9be803949075ceb7ffef74f6669be57e5d05605a
parent14b69f28c098e0ca52b61fc46375928d0bd7c3b4 (diff)
downloadgdb-c8fa6cdda407a09ab5bd2999a8fe6468b2690fb0.zip
gdb-c8fa6cdda407a09ab5bd2999a8fe6468b2690fb0.tar.gz
gdb-c8fa6cdda407a09ab5bd2999a8fe6468b2690fb0.tar.bz2
* solib.c (reload_shared_libraries): Give
inferior a chance to reset solib breakpoint. Reinit frame cache.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/solib.c22
2 files changed, 28 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d99265f..10b3429 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2008-03-09 Vladimir Prus <vladimir@codesourcery.com>
+
+ * solib.c (reload_shared_libraries): Give
+ inferior a chance to reset solib breakpoint.
+ Reinit frame cache.
+
2009-03-08 Christopher Faylor <me+cygwin@cgf.cx>
* windows-nat.c (dr): Redefine to use largest possible integer which
diff --git a/gdb/solib.c b/gdb/solib.c
index f2e68f5..0bd767e 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1015,6 +1015,28 @@ reload_shared_libraries (char *ignored, int from_tty,
{
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
+ solib-absolute-prefix and are setting it right now, then the previous
+ breakpoint address is plain wrong. Second, installing solib hooks
+ also implicitly figures were ld.so is and loads symbols for it.
+ Absent this call, if we've just connected to a target and set
+ solib-absolute-prefix or solib-search-path, we'll lose all information
+ about ld.so. */
+ if (target_has_execution)
+ {
+#ifdef SOLIB_CREATE_INFERIOR_HOOK
+ SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
+#else
+ solib_create_inferior_hook ();
+#endif
+ }
+ /* 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.
+ Reinit frame cache to avoid crashing. */
+ reinit_frame_cache ();
}
static void