breakpoint. If a "cloned-VM" event was propagated
better throughout the core, this wouldn't be
required. */
+ scoped_restore restore_in_initial_library_scan
+ = make_scoped_restore (&child_inf->in_initial_library_scan,
+ true);
solib_create_inferior_hook (0);
}
}
shared libraries, and install the solib event breakpoint.
If a "cloned-VM" event was propagated better throughout
the core, this wouldn't be required. */
+ scoped_restore restore_in_initial_library_scan
+ = make_scoped_restore (&child_inf->in_initial_library_scan, true);
solib_create_inferior_hook (0);
}
more events. Polls for events from all inferiors/targets. */
static bool
-do_target_wait (ptid_t wait_ptid, execution_control_state *ecs,
- target_wait_flags options)
+do_target_wait (execution_control_state *ecs, target_wait_flags options)
{
int num_inferiors = 0;
int random_selector;
polling the rest of the inferior list starting from that one in a
circular fashion until the whole list is polled once. */
- auto inferior_matches = [&wait_ptid] (inferior *inf)
+ auto inferior_matches = [] (inferior *inf)
{
- return (inf->process_target () != NULL
- && ptid_t (inf->pid).matches (wait_ptid));
+ return inf->process_target () != nullptr;
};
/* First see how many matching inferiors we have. */
auto do_wait = [&] (inferior *inf)
{
- ecs->ptid = do_target_wait_1 (inf, wait_ptid, &ecs->ws, options);
+ ecs->ptid = do_target_wait_1 (inf, minus_one_ptid, &ecs->ws, options);
ecs->target = inf->process_target ();
return (ecs->ws.kind != TARGET_WAITKIND_IGNORE);
};
the event. */
scoped_disable_commit_resumed disable_commit_resumed ("handling event");
- if (!do_target_wait (minus_one_ptid, ecs, TARGET_WNOHANG))
+ if (!do_target_wait (ecs, TARGET_WNOHANG))
{
infrun_debug_printf ("do_target_wait returned no event");
disable_commit_resumed.reset_and_commit ();
struct gdbarch *gdbarch = regcache->arch ();
inferior *parent_inf = find_inferior_ptid (ecs->target, ecs->ptid);
- /* If this is a fork (child gets its own address space copy) and some
- displaced step buffers were in use at the time of the fork, restore
- the displaced step buffer bytes in the child process. */
- if (ecs->ws.kind == TARGET_WAITKIND_FORKED)
+ /* If this is a fork (child gets its own address space copy)
+ and some displaced step buffers were in use at the time of
+ the fork, restore the displaced step buffer bytes in the
+ child process.
+
+ Architectures which support displaced stepping and fork
+ events must supply an implementation of
+ gdbarch_displaced_step_restore_all_in_ptid. This is not
+ enforced during gdbarch validation to support architectures
+ which support displaced stepping but not forks. */
+ if (ecs->ws.kind == TARGET_WAITKIND_FORKED
+ && gdbarch_supports_displaced_stepping (gdbarch))
gdbarch_displaced_step_restore_all_in_ptid
(gdbarch, parent_inf, ecs->ws.value.related_pid);
bool refresh_step_info = true;
if ((ecs->event_thread->suspend.stop_pc == stop_pc_sal.pc)
&& (ecs->event_thread->current_line != stop_pc_sal.line
- || ecs->event_thread->current_symtab != stop_pc_sal.symtab))
+ || ecs->event_thread->current_symtab != stop_pc_sal.symtab))
{
/* We are at a different line. */