• Home
  • Raw
  • Download

Lines Matching refs:bp

116 #define BP_NUM(bp)	((bp) - bpts + 1)  argument
456 struct bpt *bp; in xmon_core() local
473 bp = in_breakpoint_table(regs->nip, &offset); in xmon_core()
474 if (bp != NULL) { in xmon_core()
475 regs->nip = bp->address + offset; in xmon_core()
476 atomic_dec(&bp->ref_count); in xmon_core()
513 bp = NULL; in xmon_core()
515 bp = at_breakpoint(regs->nip); in xmon_core()
516 if (bp || unrecoverable_excp(regs)) in xmon_core()
522 if (bp) { in xmon_core()
524 cpu, BP_NUM(bp)); in xmon_core()
574 if (bp || TRAP(regs) == 0xd00) in xmon_core()
628 bp = at_breakpoint(regs->nip); in xmon_core()
629 if (bp) { in xmon_core()
630 printf("Stopped at breakpoint %tx (", BP_NUM(bp)); in xmon_core()
639 if (bp || TRAP(regs) == 0xd00) in xmon_core()
652 bp = at_breakpoint(regs->nip); in xmon_core()
653 if (bp != NULL) { in xmon_core()
654 regs->nip = (unsigned long) &bp->instr[0]; in xmon_core()
655 atomic_inc(&bp->ref_count); in xmon_core()
660 bp = at_breakpoint(regs->nip); in xmon_core()
661 if (bp != NULL) { in xmon_core()
662 int stepped = emulate_step(regs, bp->instr[0]); in xmon_core()
664 regs->nip = (unsigned long) &bp->instr[0]; in xmon_core()
665 atomic_inc(&bp->ref_count); in xmon_core()
668 (IS_RFID(bp->instr[0])? "rfid": "mtmsrd")); in xmon_core()
706 struct bpt *bp; in xmon_bpt() local
713 bp = in_breakpoint_table(regs->nip, &offset); in xmon_bpt()
714 if (bp != NULL && offset == 4) { in xmon_bpt()
715 regs->nip = bp->address + 4; in xmon_bpt()
716 atomic_dec(&bp->ref_count); in xmon_bpt()
721 bp = at_breakpoint(regs->nip); in xmon_bpt()
722 if (!bp) in xmon_bpt()
769 struct bpt *bp; in xmon_fault_handler() local
776 bp = in_breakpoint_table(regs->nip, &offset); in xmon_fault_handler()
777 if (bp != NULL) { in xmon_fault_handler()
778 regs->nip = bp->address + offset; in xmon_fault_handler()
779 atomic_dec(&bp->ref_count); in xmon_fault_handler()
799 struct bpt *bp; in at_breakpoint() local
801 bp = bpts; in at_breakpoint()
802 for (i = 0; i < NBPTS; ++i, ++bp) in at_breakpoint()
803 if (bp->enabled && pc == bp->address) in at_breakpoint()
804 return bp; in at_breakpoint()
825 struct bpt *bp; in new_breakpoint() local
828 bp = at_breakpoint(a); in new_breakpoint()
829 if (bp) in new_breakpoint()
830 return bp; in new_breakpoint()
832 for (bp = bpts; bp < &bpts[NBPTS]; ++bp) { in new_breakpoint()
833 if (!bp->enabled && atomic_read(&bp->ref_count) == 0) { in new_breakpoint()
834 bp->address = a; in new_breakpoint()
835 bp->instr[1] = bpinstr; in new_breakpoint()
836 store_inst(&bp->instr[1]); in new_breakpoint()
837 return bp; in new_breakpoint()
848 struct bpt *bp; in insert_bpts() local
850 bp = bpts; in insert_bpts()
851 for (i = 0; i < NBPTS; ++i, ++bp) { in insert_bpts()
852 if ((bp->enabled & (BP_TRAP|BP_CIABR)) == 0) in insert_bpts()
854 if (mread(bp->address, &bp->instr[0], 4) != 4) { in insert_bpts()
856 "disabling breakpoint there\n", bp->address); in insert_bpts()
857 bp->enabled = 0; in insert_bpts()
860 if (IS_MTMSRD(bp->instr[0]) || IS_RFID(bp->instr[0])) { in insert_bpts()
862 "instruction, disabling it\n", bp->address); in insert_bpts()
863 bp->enabled = 0; in insert_bpts()
866 store_inst(&bp->instr[0]); in insert_bpts()
867 if (bp->enabled & BP_CIABR) in insert_bpts()
869 if (patch_instruction((unsigned int *)bp->address, in insert_bpts()
872 "disabling breakpoint there\n", bp->address); in insert_bpts()
873 bp->enabled &= ~BP_TRAP; in insert_bpts()
876 store_inst((void *)bp->address); in insert_bpts()
898 struct bpt *bp; in remove_bpts() local
901 bp = bpts; in remove_bpts()
902 for (i = 0; i < NBPTS; ++i, ++bp) { in remove_bpts()
903 if ((bp->enabled & (BP_TRAP|BP_CIABR)) != BP_TRAP) in remove_bpts()
905 if (mread(bp->address, &instr, 4) == 4 in remove_bpts()
908 (unsigned int *)bp->address, bp->instr[0]) != 0) in remove_bpts()
910 bp->address); in remove_bpts()
912 store_inst((void *)bp->address); in remove_bpts()
1319 struct bpt *bp; in bpt_cmds() local
1367 bp = new_breakpoint(a); in bpt_cmds()
1368 if (bp != NULL) { in bpt_cmds()
1369 bp->enabled |= BP_CIABR; in bpt_cmds()
1370 iabr = bp; in bpt_cmds()
1389 bp = &bpts[a-1]; /* bp nums are 1 based */ in bpt_cmds()
1392 bp = at_breakpoint(a); in bpt_cmds()
1393 if (bp == NULL) { in bpt_cmds()
1399 printf("Cleared breakpoint %tx (", BP_NUM(bp)); in bpt_cmds()
1400 xmon_print_symbol(bp->address, " ", ")\n"); in bpt_cmds()
1401 bp->enabled = 0; in bpt_cmds()
1423 for (bp = bpts; bp < &bpts[NBPTS]; ++bp) { in bpt_cmds()
1424 if (!bp->enabled) in bpt_cmds()
1426 printf("%tx %s ", BP_NUM(bp), in bpt_cmds()
1427 (bp->enabled & BP_CIABR) ? "inst": "trap"); in bpt_cmds()
1428 xmon_print_symbol(bp->address, " ", "\n"); in bpt_cmds()
1435 bp = new_breakpoint(a); in bpt_cmds()
1436 if (bp != NULL) { in bpt_cmds()
1437 bp->enabled |= BP_TRAP; in bpt_cmds()