diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2008-08-09 12:15:10 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2008-08-09 12:15:10 +0000 |
commit | b9db4cedffdf2dadeac790e78d1d0a8583da3fef (patch) | |
tree | 124bb97a02396cebf04de28c98d3db57d5c62033 /gdb/target.c | |
parent | a8caa2450b3abe46aeec4ccd61ccc9b680ebb2ff (diff) | |
download | fsf-binutils-gdb-b9db4cedffdf2dadeac790e78d1d0a8583da3fef.zip fsf-binutils-gdb-b9db4cedffdf2dadeac790e78d1d0a8583da3fef.tar.gz fsf-binutils-gdb-b9db4cedffdf2dadeac790e78d1d0a8583da3fef.tar.bz2 |
* target.c: Include "solib.h".
(target_pre_inferior): Call no_shared_libraries.
* infcmd.c (run_command_1): Do not call objfile_purge_solibs
or clear_solib.
(attach_command): Do not call clear_solib.
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c index 461cfe3..6cda095 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -40,6 +40,7 @@ #include "exceptions.h" #include "target-descriptions.h" #include "gdbthread.h" +#include "solib.h" static void target_info (char *, int); @@ -1717,6 +1718,24 @@ target_info (char *args, int from_tty) void target_pre_inferior (int from_tty) { + /* 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 GNU/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 + */ + no_shared_libraries (NULL, from_tty); + invalidate_target_mem_regions (); target_clear_description (); |