53 gdb_assert (buf.current_thread != thread);
68 bool is_free = candidate.current_thread ==
nullptr;
95 "buffer at %s, can't use.",
100 if (buffer ==
nullptr)
110 displaced_pc = buffer->
addr;
118 throw_error (MEMORY_ERROR,
119 _(
"Error accessing memory address %s (%s) for "
120 "displaced-stepping scratch space."),
125 bytes_to_string (buffer->
saved_copy).c_str ());
133 if (copy_insn_closure ==
nullptr)
150 auto reset_buffer = make_scope_exit
166 reset_buffer.release ();
173 if (buf.current_thread ==
nullptr)
185 const gdb_byte *myaddr,
int len)
187 scoped_restore save_inferior_ptid = make_scoped_restore (&
inferior_ptid);
198 &&
status.sig () != GDB_SIGNAL_TRAP)
227 if (candidate.current_thread == thread)
234 gdb_assert (buffer !=
nullptr);
240 gdb_assert (copy_insn_closure !=
nullptr);
258 thread->
ptid.to_string ().c_str (),
263 bool instruction_executed_successfully
268 rc, instruction_executed_successfully);
270 return (instruction_executed_successfully
281 if (buffer.current_thread !=
nullptr && addr == buffer.addr)
284 gdb_assert (buffer.copy_insn_closure.get () !=
nullptr);
285 return buffer.copy_insn_closure.get ();
297 if (buffer.current_thread ==
nullptr)
307 ptid.to_string ().c_str (),
318Set displaced stepping debugging."), _(
"\
319Show displaced stepping debugging."), _(
"\
320When non-zero, displaced stepping specific debugging is enabled."),
int breakpoint_in_range_p(const address_space *aspace, CORE_ADDR addr, ULONGEST len)
displaced_step_inferior_state displaced_step_state
const address_space * aspace() const
displaced_step_thread_state displaced_step_state
struct cmd_list_element * showdebuglist
struct cmd_list_element * setdebuglist
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
static bool displaced_step_instruction_executed_successfully(gdbarch *arch, const target_waitstatus &status)
static void write_memory_ptid(ptid_t ptid, CORE_ADDR memaddr, const gdb_byte *myaddr, int len)
static void show_debug_displaced(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void _initialize_displaced_stepping()
#define displaced_debug_printf(fmt,...)
displaced_step_prepare_status
@ DISPLACED_STEP_PREPARE_STATUS_CANT
@ DISPLACED_STEP_PREPARE_STATUS_UNAVAILABLE
@ DISPLACED_STEP_PREPARE_STATUS_OK
std::unique_ptr< displaced_step_copy_insn_closure > displaced_step_copy_insn_closure_up
displaced_step_finish_status
@ DISPLACED_STEP_FINISH_STATUS_OK
@ DISPLACED_STEP_FINISH_STATUS_NOT_EXECUTED
int gdbarch_have_nonsteppable_watchpoint(struct gdbarch *gdbarch)
displaced_step_copy_insn_closure_up gdbarch_displaced_step_copy_insn(struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
void gdbarch_displaced_step_fixup(struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs, bool completed_p)
ULONGEST gdbarch_displaced_step_buffer_length(struct gdbarch *gdbarch)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
CORE_ADDR regcache_read_pc(struct regcache *regcache)
void regcache_write_pc(struct regcache *regcache, CORE_ADDR pc)
struct regcache * get_thread_regcache(process_stratum_target *target, ptid_t ptid)
gdb::byte_vector saved_copy
displaced_step_copy_insn_closure_up copy_insn_closure
thread_info * current_thread
std::vector< displaced_step_buffer > m_buffers
displaced_step_prepare_status prepare(thread_info *thread, CORE_ADDR &displaced_pc)
void restore_in_ptid(ptid_t ptid)
const displaced_step_copy_insn_closure * copy_insn_closure_by_addr(CORE_ADDR addr)
displaced_step_finish_status finish(gdbarch *arch, thread_info *thread, const target_waitstatus &status)
virtual ~displaced_step_copy_insn_closure()=0
bool target_have_steppable_watchpoint()
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
bool target_stopped_by_watchpoint()
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void gdb_printf(struct ui_file *stream, const char *format,...)
@ TARGET_WAITKIND_STOPPED