Changeset View
Changeset View
Standalone View
Standalone View
lib/libproc/proc_bkpt.c
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | proc_bkptset(struct proc_handle *phdl, uintptr_t address, | ||||
*saved = 0; | *saved = 0; | ||||
if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD || | if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD || | ||||
phdl->status == PS_IDLE) { | phdl->status == PS_IDLE) { | ||||
errno = ENOENT; | errno = ENOENT; | ||||
return (-1); | return (-1); | ||||
} | } | ||||
DPRINTFX("adding breakpoint at 0x%lx", address); | DPRINTFX("adding breakpoint at 0x%lx", (unsigned long)address); | ||||
stopped = 0; | stopped = 0; | ||||
if (phdl->status != PS_STOP) { | if (phdl->status != PS_STOP) { | ||||
if (proc_stop(phdl) != 0) | if (proc_stop(phdl) != 0) | ||||
return (-1); | return (-1); | ||||
stopped = 1; | stopped = 1; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | proc_bkptdel(struct proc_handle *phdl, uintptr_t address, | ||||
instr_t instr; | instr_t instr; | ||||
if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD || | if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD || | ||||
phdl->status == PS_IDLE) { | phdl->status == PS_IDLE) { | ||||
errno = ENOENT; | errno = ENOENT; | ||||
return (-1); | return (-1); | ||||
} | } | ||||
DPRINTFX("removing breakpoint at 0x%lx", address); | DPRINTFX("removing breakpoint at 0x%lx", (unsigned long)address); | ||||
stopped = 0; | stopped = 0; | ||||
if (phdl->status != PS_STOP) { | if (phdl->status != PS_STOP) { | ||||
if (proc_stop(phdl) != 0) | if (proc_stop(phdl) != 0) | ||||
return (-1); | return (-1); | ||||
stopped = 1; | stopped = 1; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |