aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c36
1 files changed, 10 insertions, 26 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 0b87287..e0e9ffa 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -58,7 +58,6 @@
#include "target-descriptions.h"
#include "target-dcache.h"
#include "terminal.h"
-#include "solist.h"
#include "gdbsupport/event-loop.h"
#include "thread-fsm.h"
#include "gdbsupport/enum-flags.h"
@@ -68,7 +67,6 @@
#include "gdbsupport/scope-exit.h"
#include "gdbsupport/forward-scope-exit.h"
#include "gdbsupport/gdb_select.h"
-#include <unordered_map>
#include "async-event.h"
#include "gdbsupport/selftest.h"
#include "scoped-mock-context.h"
@@ -95,8 +93,6 @@ static void insert_step_resume_breakpoint_at_caller (const frame_info_ptr &);
static void insert_longjmp_resume_breakpoint (struct gdbarch *, CORE_ADDR);
-static bool maybe_software_singlestep (struct gdbarch *gdbarch);
-
static void resume (gdb_signal sig);
static void wait_for_inferior (inferior *inf);
@@ -473,6 +469,7 @@ holding the child stopped. Try \"set %ps\" or \"%ps\".\n"),
inferior *parent_inf = current_inferior ();
inferior *child_inf = nullptr;
+ bool child_has_new_pspace = false;
gdb_assert (parent_inf->thread_waiting_for_vfork_done == nullptr);
@@ -537,6 +534,7 @@ holding the child stopped. Try \"set %ps\" or \"%ps\".\n"),
else
{
child_inf->pspace = new program_space (new_address_space ());
+ child_has_new_pspace = true;
child_inf->aspace = child_inf->pspace->aspace;
child_inf->removable = true;
clone_program_space (child_inf->pspace, parent_inf->pspace);
@@ -626,6 +624,7 @@ holding the child stopped. Try \"set %ps\" or \"%ps\".\n"),
else
{
child_inf->pspace = new program_space (new_address_space ());
+ child_has_new_pspace = true;
child_inf->aspace = child_inf->pspace->aspace;
child_inf->removable = true;
child_inf->symfile_flags = SYMFILE_NO_READ;
@@ -724,7 +723,8 @@ holding the child stopped. Try \"set %ps\" or \"%ps\".\n"),
maybe_restore.emplace ();
switch_to_thread (*child_inf->threads ().begin ());
- post_create_inferior (0);
+
+ post_create_inferior (0, child_has_new_pspace);
}
return false;
@@ -1322,6 +1322,7 @@ follow_exec (ptid_t ptid, const char *exec_file_target)
we don't want those to be satisfied by the libraries of the
previous incarnation of this process. */
no_shared_libraries (current_program_space);
+ current_program_space->unset_solib_ops ();
inferior *execing_inferior = current_inferior ();
inferior *following_inferior;
@@ -1378,6 +1379,8 @@ follow_exec (ptid_t ptid, const char *exec_file_target)
registers. */
target_find_description ();
+ current_program_space->set_solib_ops
+ (gdbarch_make_solib_ops (following_inferior->arch ()));
gdb::observers::inferior_execd.notify (execing_inferior, following_inferior);
breakpoint_re_set ();
@@ -2354,23 +2357,6 @@ set_schedlock_func (const char *args, int from_tty, struct cmd_list_element *c)
process. */
bool sched_multi = false;
-/* Try to setup for software single stepping. Return true if target_resume()
- should use hardware single step.
-
- GDBARCH the current gdbarch. */
-
-static bool
-maybe_software_singlestep (struct gdbarch *gdbarch)
-{
- bool hw_step = true;
-
- if (execution_direction == EXEC_FORWARD
- && gdbarch_software_single_step_p (gdbarch))
- hw_step = !insert_single_step_breakpoints (gdbarch);
-
- return hw_step;
-}
-
/* See infrun.h. */
ptid_t
@@ -3819,7 +3805,7 @@ start_remote (int from_tty)
/* Now that the inferior has stopped, do any bookkeeping like
loading shared libraries. We want to do this before normal_stop,
so that the displayed frame is up to date. */
- post_create_inferior (from_tty);
+ post_create_inferior (from_tty, true);
normal_stop ();
}
@@ -10532,9 +10518,7 @@ infrun_thread_ptid_changed ()
#endif /* GDB_SELF_TEST */
-void _initialize_infrun ();
-void
-_initialize_infrun ()
+INIT_GDB_FILE (infrun)
{
struct cmd_list_element *c;