aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-10-17 17:45:17 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-10-17 17:45:17 +0000
commitc1e56572463d2126e46eda8ce8d4bce221667f98 (patch)
tree3f7dae8a1dd565c8c77dc068337ad5896d2f91ce /gdb/infrun.c
parent0c91cf04574d756ea883ec506a84fb7ac9589459 (diff)
downloadgdb-c1e56572463d2126e46eda8ce8d4bce221667f98.zip
gdb-c1e56572463d2126e46eda8ce8d4bce221667f98.tar.gz
gdb-c1e56572463d2126e46eda8ce8d4bce221667f98.tar.bz2
gdb/
* infrun.c (follow_exec): Replace symbol_file_add_main by symbol_file_add with SYMFILE_DEFER_BP_RESET, set_initial_language and breakpoint_re_set. * m32r-rom.c (m32r_load, m32r_upload_command): Use parameter 0 for clear_symtab_users. * objfiles.c (free_all_objfiles): Likewise. * remote-m32r-sdi.c (m32r_load): Likewise. * solib-som.c (som_solib_create_inferior_hook): Likewise. * symfile.c (new_symfile_objfile): New comment for add_flags. Call clear_symtab_users with ADD_FLAGS. (reread_symbols): Use parameter 0 for clear_symtab_users. (clear_symtab_users): New parameter add_flags. Do not call breakpoint_re_set if SYMFILE_DEFER_BP_RESET. (clear_symtab_users_cleanup): Use parameter 0 for clear_symtab_users. * symtab.h (clear_symtab_users): New parameter add_flags. gdb/testsuite/ * gdb.base/pie-execl.exp: New file. * gdb.base/pie-execl.c: New file.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 0720b31..240cd95 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -835,8 +835,15 @@ follow_exec (ptid_t pid, char *execd_pathname)
/* That a.out is now the one to use. */
exec_file_attach (execd_pathname, 0);
- /* Load the main file's symbols. */
- symbol_file_add_main (execd_pathname, 0);
+ /* SYMFILE_DEFER_BP_RESET is used as the proper displacement for PIE
+ (Position Independent Executable) main symbol file will get applied by
+ solib_create_inferior_hook below. breakpoint_re_set would fail to insert
+ the breakpoints with the zero displacement. */
+
+ symbol_file_add (execd_pathname, SYMFILE_MAINLINE | SYMFILE_DEFER_BP_RESET,
+ NULL, 0);
+
+ set_initial_language ();
#ifdef SOLIB_CREATE_INFERIOR_HOOK
SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
@@ -846,6 +853,8 @@ follow_exec (ptid_t pid, char *execd_pathname)
jit_inferior_created_hook ();
+ breakpoint_re_set ();
+
/* Reinsert all breakpoints. (Those which were symbolic have
been reset to the proper address in the new a.out, thanks
to symbol_file_command...) */