| 296 | */ |
| 297 | |
| 298 | void |
| 299 | db_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 | |
| 320 | void |
| 321 | db_clear_single_step(void) |
no test coverage detected