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

Function dbg_find_slot

freebsd/arm/arm/debug_monitor.c:520–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520static u_int
521dbg_find_slot(enum dbg_t type, db_expr_t addr)
522{
523 uint32_t reg_addr, reg_ctrl;
524 u_int max, i;
525
526 switch(type) {
527 case DBG_TYPE_BREAKPOINT:
528 max = dbg_breakpoint_num;
529 reg_addr = DBG_REG_BASE_BVR;
530 reg_ctrl = DBG_REG_BASE_BCR;
531 break;
532 case DBG_TYPE_WATCHPOINT:
533 max = dbg_watchpoint_num;
534 reg_addr = DBG_REG_BASE_WVR;
535 reg_ctrl = DBG_REG_BASE_WCR;
536 break;
537 default:
538 db_printf("Unsupported debug type\n");
539 return (~0U);
540 }
541
542 for (i = 0; i < max; i++) {
543 if ((dbg_wb_read_reg(reg_addr, i) == addr) &&
544 ((dbg_wb_read_reg(reg_ctrl, i) & DBG_WB_CTRL_E) != 0))
545 return (i);
546 }
547
548 return (~0U);
549}
550
551static __inline boolean_t
552dbg_monitor_is_enabled(void)

Callers 2

kdb_cpu_pc_is_singlestepFunction · 0.70
dbg_remove_xpointFunction · 0.70

Calls 2

db_printfFunction · 0.85
dbg_wb_read_regFunction · 0.70

Tested by

no test coverage detected