diff options
author | Pedro Alves <palves@redhat.com> | 2008-07-08 10:31:16 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-07-08 10:31:16 +0000 |
commit | cce9b6bff92ae507e4517198c4b64e268f975760 (patch) | |
tree | dec5a23fc60b028fc475900d9e5c4748beba74f6 /gdb/infrun.c | |
parent | 72d4c02fe8da31ccb118ac692b22f5cbf6be0d1a (diff) | |
download | gdb-cce9b6bff92ae507e4517198c4b64e268f975760.zip gdb-cce9b6bff92ae507e4517198c4b64e268f975760.tar.gz gdb-cce9b6bff92ae507e4517198c4b64e268f975760.tar.bz2 |
* infrun.c (follow_exec): Reset shared libraries before adding the
main exec file.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index 2c4ebc8..dbb6110 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -419,13 +419,17 @@ follow_exec (int pid, char *execd_pathname) /* That a.out is now the one to use. */ exec_file_attach (execd_pathname, 0); - /* And also is where symbols can be found. */ + /* Reset the shared library package. This ensures that we get a + shlib event when the child reaches "_start", at which point the + dld will have had a chance to initialize the child. */ + /* Also, loading a symbol file below may trigger symbol lookups, and + we don't want those to be satisfied by the libraries of the + previous incarnation of this process. */ + no_shared_libraries (NULL, 0); + + /* Load the main file's symbols. */ symbol_file_add_main (execd_pathname, 0); - /* Reset the shared library package. This ensures that we get - a shlib event when the child reaches "_start", at which point - the dld will have had a chance to initialize the child. */ - no_shared_libraries (NULL, 0); #ifdef SOLIB_CREATE_INFERIOR_HOOK SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid)); #else |