aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-01-17 16:47:55 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-01-17 16:47:55 +0000
commit4bcff7eb8534c90270f0b574a244d99648906f36 (patch)
tree7ce79e1dd0ea02df46b3e31df90006d1af254190 /gdb/infcmd.c
parentb09a777222bf0a743061b84e490c28171cced25b (diff)
downloadgdb-4bcff7eb8534c90270f0b574a244d99648906f36.zip
gdb-4bcff7eb8534c90270f0b574a244d99648906f36.tar.gz
gdb-4bcff7eb8534c90270f0b574a244d99648906f36.tar.bz2
* infcmd.c (attach_command): Call CLEAR_SOLIB if available.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 3b5c45e..7f40180 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1776,6 +1776,26 @@ attach_command (char *args, int from_tty)
error ("Not killed.");
}
+ /* Clear out solib state. Otherwise the solib state of the previous
+ inferior might have survived and is entirely wrong for the new
+ target. This has been observed on Linux using glibc 2.3. How to
+ reproduce:
+
+ bash$ ./foo&
+ [1] 4711
+ bash$ ./foo&
+ [1] 4712
+ bash$ gdb ./foo
+ [...]
+ (gdb) attach 4711
+ (gdb) detach
+ (gdb) attach 4712
+ Cannot access memory at address 0xdeadbeef
+ */
+#ifdef CLEAR_SOLIB
+ CLEAR_SOLIB ();
+#endif
+
target_attach (args, from_tty);
/* Set up the "saved terminal modes" of the inferior