| 493 | } |
| 494 | |
| 495 | static u_int |
| 496 | dbg_find_free_slot(enum dbg_t type) |
| 497 | { |
| 498 | u_int max, i; |
| 499 | |
| 500 | switch(type) { |
| 501 | case DBG_TYPE_BREAKPOINT: |
| 502 | max = dbg_breakpoint_num; |
| 503 | break; |
| 504 | case DBG_TYPE_WATCHPOINT: |
| 505 | max = dbg_watchpoint_num; |
| 506 | break; |
| 507 | default: |
| 508 | db_printf("Unsupported debug type\n"); |
| 509 | return (~0U); |
| 510 | } |
| 511 | |
| 512 | for (i = 0; i < max; i++) { |
| 513 | if (dbg_check_slot_free(type, i)) |
| 514 | return (i); |
| 515 | } |
| 516 | |
| 517 | return (~0U); |
| 518 | } |
| 519 | |
| 520 | static u_int |
| 521 | dbg_find_slot(enum dbg_t type, db_expr_t addr) |
no test coverage detected