46,6 → 46,11 |
|
#define OPCODE_INT3 0xCC |
|
void arch_dthread_initialize(dthread_t *dt) |
{ |
dt->arch.singlestep = false; |
} |
|
static int _set_trap_flag(dthread_t *dt, bool enable) |
{ |
static istate_t istate; |
52,13 → 57,13 |
int rc; |
|
rc = udebug_regs_read(app_phone, dt->hash, &istate); |
if (rc < 0) { printf("regs read failed\n"); return; } |
if (rc < 0) { printf("regs read failed\n"); return -1; } |
|
if (enable) istate.eflags |= 0x0100; /* trap flag */ |
else if (!active_bkpt) istate.eflags &= ~0x0100; /* trap flag */ |
|
rc = udebug_regs_write(app_phone, dt->hash, &istate); |
if (rc < 0) { printf("regs write failed\n"); return; } |
if (rc < 0) { printf("regs write failed\n"); return -1; } |
|
return 0; |
} |