Lines Matching refs:bp

40 static char *kdb_bptype(kdb_bp_t *bp)  in kdb_bptype()  argument
42 if (bp->bp_type < 0 || bp->bp_type > 4) in kdb_bptype()
45 return kdb_rwtypes[bp->bp_type]; in kdb_bptype()
48 static int kdb_parsebp(int argc, const char **argv, int *nextargp, kdb_bp_t *bp) in kdb_parsebp() argument
53 bp->bph_length = 1; in kdb_parsebp()
56 bp->bp_type = BP_ACCESS_WATCHPOINT; in kdb_parsebp()
58 bp->bp_type = BP_WRITE_WATCHPOINT; in kdb_parsebp()
60 bp->bp_type = BP_HARDWARE_BREAKPOINT; in kdb_parsebp()
64 bp->bph_length = 1; in kdb_parsebp()
80 bp->bph_length = len; in kdb_parsebp()
92 static int _kdb_bp_remove(kdb_bp_t *bp) in _kdb_bp_remove() argument
95 if (!bp->bp_installed) in _kdb_bp_remove()
97 if (!bp->bp_type) in _kdb_bp_remove()
98 ret = dbg_remove_sw_break(bp->bp_addr); in _kdb_bp_remove()
100 ret = arch_kgdb_ops.remove_hw_breakpoint(bp->bp_addr, in _kdb_bp_remove()
101 bp->bph_length, in _kdb_bp_remove()
102 bp->bp_type); in _kdb_bp_remove()
104 bp->bp_installed = 0; in _kdb_bp_remove()
108 static void kdb_handle_bp(struct pt_regs *regs, kdb_bp_t *bp) in kdb_handle_bp() argument
121 bp->bp_delay = 0; in kdb_handle_bp()
122 bp->bp_delayed = 1; in kdb_handle_bp()
125 static int _kdb_bp_install(struct pt_regs *regs, kdb_bp_t *bp) in _kdb_bp_install() argument
134 __func__, bp->bp_installed); in _kdb_bp_install()
136 bp->bp_delay = 0; in _kdb_bp_install()
137 if (bp->bp_installed) in _kdb_bp_install()
139 if (bp->bp_delay || (bp->bp_delayed && KDB_STATE(DOING_SS))) { in _kdb_bp_install()
142 kdb_handle_bp(regs, bp); in _kdb_bp_install()
145 if (!bp->bp_type) in _kdb_bp_install()
146 ret = dbg_set_sw_break(bp->bp_addr); in _kdb_bp_install()
148 ret = arch_kgdb_ops.set_hw_breakpoint(bp->bp_addr, in _kdb_bp_install()
149 bp->bph_length, in _kdb_bp_install()
150 bp->bp_type); in _kdb_bp_install()
152 bp->bp_installed = 1; in _kdb_bp_install()
155 __func__, bp->bp_addr); in _kdb_bp_install()
156 if (!bp->bp_type) { in _kdb_bp_install()
179 kdb_bp_t *bp = &kdb_breakpoints[i]; in kdb_bp_install() local
183 __func__, i, bp->bp_enabled); in kdb_bp_install()
185 if (bp->bp_enabled) in kdb_bp_install()
186 _kdb_bp_install(regs, bp); in kdb_bp_install()
210 kdb_bp_t *bp = &kdb_breakpoints[i]; in kdb_bp_remove() local
214 __func__, i, bp->bp_enabled); in kdb_bp_remove()
216 if (bp->bp_enabled) in kdb_bp_remove()
217 _kdb_bp_remove(bp); in kdb_bp_remove()
238 static void kdb_printbp(kdb_bp_t *bp, int i) in kdb_printbp() argument
240 kdb_printf("%s ", kdb_bptype(bp)); in kdb_printbp()
242 kdb_symbol_print(bp->bp_addr, NULL, KDB_SP_DEFAULT); in kdb_printbp()
244 if (bp->bp_enabled) in kdb_printbp()
250 bp->bp_addr, bp->bp_type, bp->bp_installed); in kdb_printbp()
280 kdb_bp_t *bp, *bp_check; in kdb_bp() local
291 for (bpno = 0, bp = kdb_breakpoints; bpno < KDB_MAXBPT; in kdb_bp()
292 bpno++, bp++) { in kdb_bp()
293 if (bp->bp_free) in kdb_bp()
295 kdb_printbp(bp, bpno); in kdb_bp()
321 for (bpno = 0, bp = kdb_breakpoints; bpno < KDB_MAXBPT; bpno++, bp++) { in kdb_bp()
322 if (bp->bp_free) in kdb_bp()
359 *bp = template; in kdb_bp()
360 bp->bp_free = 0; in kdb_bp()
362 kdb_printbp(bp, bpno); in kdb_bp()
389 kdb_bp_t *bp = NULL; in kdb_bc() local
427 for (i = 0, bp = kdb_breakpoints; i < KDB_MAXBPT; in kdb_bc()
428 i++, bp++) { in kdb_bc()
429 if (bp->bp_addr == addr) { in kdb_bc()
442 for (bp = &kdb_breakpoints[lowbp], i = lowbp; in kdb_bc()
444 i++, bp++) { in kdb_bc()
445 if (bp->bp_free) in kdb_bc()
452 bp->bp_enabled = 0; in kdb_bc()
456 i, bp->bp_addr); in kdb_bc()
458 bp->bp_addr = 0; in kdb_bc()
459 bp->bp_free = 1; in kdb_bc()
463 bp->bp_enabled = 1; in kdb_bc()
467 i, bp->bp_addr); in kdb_bc()
472 if (!bp->bp_enabled) in kdb_bc()
475 bp->bp_enabled = 0; in kdb_bc()
479 i, bp->bp_addr); in kdb_bc()
483 if (bp->bp_delay && (cmd == KDBCMD_BC || cmd == KDBCMD_BD)) { in kdb_bc()
484 bp->bp_delay = 0; in kdb_bc()
578 kdb_bp_t *bp; in kdb_initbptab() local
585 for (i = 0, bp = kdb_breakpoints; i < KDB_MAXBPT; i++, bp++) in kdb_initbptab()
586 bp->bp_free = 1; in kdb_initbptab()