* infcmd.c (attach_command): Call CLEAR_SOLIB if available.
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 17 Jan 2005 16:47:55 +0000 (16:47 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 17 Jan 2005 16:47:55 +0000 (16:47 +0000)
gdb/ChangeLog
gdb/infcmd.c

index 41223e961b77b7483ecb1cc9d74943507b68276e..e2d2a6cbb1477a6e96f3e7b827118a14c8ff6e76 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-17  Corinna Vinschen  <vinschen@redhat.com>
+
+       * infcmd.c (attach_command): Call CLEAR_SOLIB if available.
+
 2005-01-17  Andrew Cagney  <cagney@gnu.org>
 
        * top.h (source_error, source_pre_error): Delete declaration.
index 3b5c45e173dc08403586ce8725931b0392e8224b..7f401801cdba59640602439678f130e0e8cf33c1 100644 (file)
@@ -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
This page took 0.02798 seconds and 4 git commands to generate.