MCPcopy Create free account
hub / github.com/F-Stack/f-stack / db_set_single_step

Function db_set_single_step

freebsd/ddb/db_run.c:298–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296 */
297
298void
299db_set_single_step(void)
300{
301 db_addr_t pc = PC_REGS(), brpc;
302 unsigned inst;
303
304 /*
305 * User was stopped at pc, e.g. the instruction
306 * at pc was not executed.
307 */
308 inst = db_get_value(pc, sizeof(int), false);
309 if (inst_branch(inst) || inst_call(inst) || inst_return(inst)) {
310 brpc = branch_taken(inst, pc);
311 if (brpc != pc) { /* self-branches are hopeless */
312 db_taken_bkpt = db_set_temp_breakpoint(brpc);
313 }
314 pc = next_instr_address(pc, 1);
315 }
316 pc = next_instr_address(pc, 0);
317 db_not_taken_bkpt = db_set_temp_breakpoint(pc);
318}
319
320void
321db_clear_single_step(void)

Callers 1

db_restart_at_pcFunction · 0.85

Calls 4

db_get_valueFunction · 0.85
db_set_temp_breakpointFunction · 0.85
next_instr_addressFunction · 0.85
branch_takenFunction · 0.50

Tested by

no test coverage detected