Show triggered breakpoints (and watchpoints in sim).
The "regs" command indicates when the PC is sitting on an enabled breakpoint. The simulator emits debug output when a watchpoint is triggered by a simulated instruction.
This commit is contained in:
parent
38ea6143cd
commit
89e6174b9f
|
@ -68,6 +68,8 @@ static void watchpoint_check(struct sim_device *dev, uint16_t addr,
|
|||
((bp->type == DEVICE_BPTYPE_WATCH ||
|
||||
(bp->type == DEVICE_BPTYPE_READ && !is_write) ||
|
||||
(bp->type == DEVICE_BPTYPE_WRITE && is_write)))) {
|
||||
printc_dbg("Watchpoint %d triggered (0x%04x, %s)\n",
|
||||
i, addr, is_write ? "WRITE" : "READ");
|
||||
dev->watchpoint_hit = 1;
|
||||
return;
|
||||
}
|
||||
|
|
14
ui/devcmd.c
14
ui/devcmd.c
|
@ -38,11 +38,25 @@ int cmd_regs(char **arg)
|
|||
address_t regs[DEVICE_NUM_REGS];
|
||||
uint8_t code[16];
|
||||
int len = sizeof(code);
|
||||
int i;
|
||||
|
||||
(void)arg;
|
||||
|
||||
if (device_getregs(regs) < 0)
|
||||
return -1;
|
||||
|
||||
/* Check for breakpoints */
|
||||
for (i = 0; i < device_default->max_breakpoints; i++) {
|
||||
const struct device_breakpoint *bp =
|
||||
&device_default->breakpoints[i];
|
||||
|
||||
if ((bp->flags & DEVICE_BP_ENABLED) &&
|
||||
(bp->type == DEVICE_BPTYPE_BREAK) &&
|
||||
(bp->addr == regs[MSP430_REG_PC]))
|
||||
printc("Breakpoint %d triggered (0x%04x)\n",
|
||||
i, bp->addr);
|
||||
}
|
||||
|
||||
show_regs(regs);
|
||||
|
||||
/* Try to disassemble the instruction at PC */
|
||||
|
|
Loading…
Reference in New Issue