#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 <sys/types.h>
#include <fcntl.h>
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 ();
}
}
unsigned long write_count,
std::chrono::steady_clock::duration d);
+/* See symfile.h. */
+
void
generic_load (const char *args, int from_tty)
{