X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fsymfile.c;h=13a07e4dc0e57eff06680b25d921c5009dc20e07;hb=268a13a5a3f7c6b9b6ffc5ac2d1b24eb41f3fbdc;hp=6f9c81c8b9489bab878e4839e79b9104a4dac005;hpb=f568655424ad268c8c5df3f56e4e19a86b16623d;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/symfile.c b/gdb/symfile.c index 6f9c81c8b9..13a07e4dc0 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -56,11 +56,11 @@ #include "stack.h" #include "gdb_bfd.h" #include "cli/cli-utils.h" -#include "common/byte-vector.h" -#include "common/pathstuff.h" -#include "common/selftest.h" +#include "gdbsupport/byte-vector.h" +#include "gdbsupport/pathstuff.h" +#include "gdbsupport/selftest.h" #include "cli/cli-style.h" -#include "common/forward-scope-exit.h" +#include "gdbsupport/forward-scope-exit.h" #include #include @@ -1672,7 +1672,19 @@ symbol_file_command (const char *args, int from_tty) validate_readnow_readnever (flags); + /* Set SYMFILE_DEFER_BP_RESET because the proper displacement for a PIE + (Position Independent Executable) main symbol file will only be + computed by the solib_create_inferior_hook below. Without it, + breakpoint_re_set would fail to insert the breakpoints with the zero + displacement. */ + add_flags |= SYMFILE_DEFER_BP_RESET; + symbol_file_add_main_1 (name, add_flags, flags, offset); + + solib_create_inferior_hook (from_tty); + + /* Now it's safe to re-add the breakpoints. */ + breakpoint_re_set (); } } @@ -2023,6 +2035,8 @@ static void print_transfer_performance (struct ui_file *stream, unsigned long write_count, std::chrono::steady_clock::duration d); +/* See symfile.h. */ + void generic_load (const char *args, int from_tty) {