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

Function db_restart_at_pc

freebsd/ddb/db_run.c:219–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219void
220db_restart_at_pc(bool watchpt)
221{
222 db_addr_t pc = PC_REGS();
223
224 if ((db_run_mode == STEP_COUNT) ||
225 ((db_run_mode == STEP_ONCE) && db_sstep_multiple) ||
226 (db_run_mode == STEP_RETURN) ||
227 (db_run_mode == STEP_CALLT)) {
228 /*
229 * We are about to execute this instruction,
230 * so count it now.
231 */
232#ifdef SOFTWARE_SSTEP
233 db_expr_t ins =
234#endif
235 db_get_value(pc, sizeof(int), false);
236 db_inst_count++;
237 db_load_count += inst_load(ins);
238 db_store_count += inst_store(ins);
239#ifdef SOFTWARE_SSTEP
240 /* XXX works on mips, but... */
241 if (inst_branch(ins) || inst_call(ins)) {
242 ins = db_get_value(next_instr_address(pc,1),
243 sizeof(int), false);
244 db_inst_count++;
245 db_load_count += inst_load(ins);
246 db_store_count += inst_store(ins);
247 }
248#endif /* SOFTWARE_SSTEP */
249 }
250
251 if (db_run_mode == STEP_CONTINUE) {
252 if (watchpt || db_find_breakpoint_here(pc)) {
253 /*
254 * Step over breakpoint/watchpoint.
255 */
256 db_run_mode = STEP_INVISIBLE;
257 db_set_single_step();
258 } else {
259 db_set_breakpoints();
260 db_set_watchpoints();
261 }
262 } else {
263 db_set_single_step();
264 }
265}
266
267#ifdef SOFTWARE_SSTEP
268/*

Callers 1

db_trapFunction · 0.85

Calls 6

db_get_valueFunction · 0.85
next_instr_addressFunction · 0.85
db_find_breakpoint_hereFunction · 0.85
db_set_single_stepFunction · 0.85
db_set_breakpointsFunction · 0.85
db_set_watchpointsFunction · 0.85

Tested by

no test coverage detected