struct gdbarch *gdbarch = regcache->arch ();
struct arm_get_next_pcs next_pcs_ctx;
- /* If the target does have hardware single step, GDB doesn't have
- to bother software single step. */
- if (target_can_do_single_step () == 1)
- return {};
-
arm_get_next_pcs_ctor (&next_pcs_ctx,
&arm_linux_get_next_pcs_ops,
gdbarch_byte_order (gdbarch),
update_global_location_list (UGLL_INSERT);
}
-/* Insert single step breakpoints according to the current state. */
+/* Try to setup for software single stepping. Return true if
+ target_resume() should use hardware single step.
-int
-insert_single_step_breakpoints (struct gdbarch *gdbarch)
+ GDBARCH is the current gdbarch. */
+
+bool
+maybe_software_singlestep (struct gdbarch *gdbarch)
{
+ if (execution_direction != EXEC_FORWARD)
+ return true;
+
+ if (target_can_do_single_step () == 1)
+ {
+ /* The target definitely has hardware single step. */
+ return true;
+ }
+
+ if (!gdbarch_software_single_step_p (gdbarch))
+ return true;
+
regcache *regcache = get_thread_regcache (inferior_thread ());
std::vector<CORE_ADDR> next_pcs;
for (CORE_ADDR pc : next_pcs)
insert_single_step_breakpoint (gdbarch, aspace, pc);
- return 1;
+ return false;
}
else
- return 0;
+ return true;
}
/* See breakpoint.h. */
const address_space *,
CORE_ADDR);
-/* Insert all software single step breakpoints for the current frame.
- Return true if any software single step breakpoints are inserted,
- otherwise, return false. */
-extern int insert_single_step_breakpoints (struct gdbarch *);
+/* Try to setup for software single stepping. Return true if
+ target_resume() should use hardware single step. GDBARCH is the
+ current gdbarch. */
+extern bool maybe_software_singlestep (struct gdbarch *);
/* Check whether any hardware watchpoints have triggered or not,
according to the target, and record it in each watchpoint's
extern CORE_ADDR gdbarch_memtag_granule_size (struct gdbarch *gdbarch);
extern void set_gdbarch_memtag_granule_size (struct gdbarch *gdbarch, CORE_ADDR memtag_granule_size);
-/* FIXME/cagney/2001-01-18: This should be split in two. A target method that
- indicates if the target needs software single step. An ISA method to
- implement it.
+/* Return a vector of addresses at which the software single step
+ breakpoints should be inserted. An empty vector means software single
+ step is not used.
- FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the
- target can single step. If not, then implement single step using breakpoints.
-
- Return a vector of addresses on which the software single step
- breakpoints should be inserted. NULL means software single step is
- not used.
Multiple breakpoints may be inserted for some instructions such as
conditional branch. However, each implementation must always evaluate
the condition and only put the breakpoint at the branch destination if
Function(
comment="""
-FIXME/cagney/2001-01-18: This should be split in two. A target method that
-indicates if the target needs software single step. An ISA method to
-implement it.
+Return a vector of addresses at which the software single step
+breakpoints should be inserted. An empty vector means software single
+step is not used.
-FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the
-target can single step. If not, then implement single step using breakpoints.
-
-Return a vector of addresses on which the software single step
-breakpoints should be inserted. NULL means software single step is
-not used.
Multiple breakpoints may be inserted for some instructions such as
conditional branch. However, each implementation must always evaluate
the condition and only put the breakpoint at the branch destination if
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);
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
record_full_resume_step = 1;
}
else
- step = !insert_single_step_breakpoints (gdbarch);
+ step = maybe_software_singlestep (gdbarch);
}
}
};
reinit_frame_cache ();
- step = !insert_single_step_breakpoints (gdbarch);
+ step = maybe_software_singlestep (gdbarch);
}
if (record_debug)