subsys/debug/gdb_server.c
/*
 * Physically install breakpoints, and make sure that modified memory is
 * flushed on all CPUs.
 *
 * Must only be called when ready to exit the CPU control loop.
 */
Physically install breakpoints, and make sure that modified memory is
flushed on all CPUs.

Must only be called when ready to exit the CPU control loop.
Physically install breakpoints and make sure that modified memory is flushed on all CPUs . Must only be called when ready to exit the CPU control loop .
static void install_breakpoints(void)
{
	gdb_instr_t instr = GDB_BREAK_INSTRUCTION;
	for (int ix = 0; ix < MAX_SW_BP; ix++) {
		if (bp_array[ix].valid && !bp_array[ix].enabled) {
			gdb_instr_t *addr = bp_array[ix].addr;
			bp_array[ix].instr = *addr;
			(void)set_instruction(addr, &instr, sizeof(instr));
			bp_array[ix].enabled = 1;
		} else if (!bp_array[ix].valid) {
			break;
		}
	}
	set_debug_regs_for_hw_breakpoints();
}
static void install_breakpoints ( void ) { gdb_instr_t instr = GDB_BREAK_INSTRUCTION ; for ( int ix = 0 ; ix < MAX_SW_BP ; ix ++ ) { if ( bp_array [ ix ] . valid && ! bp_array [ ix ] . enabled ) { gdb_instr_t * addr = bp_array [ ix ] . addr ; bp_array [ ix ] . instr = * addr ; ( void ) set_instruction ( addr , & instr , sizeof ( instr ) ) ; bp_array [ ix ] . enabled = 1 ; } else if ( ! bp_array [ ix ] . valid ) { break ; } } set_debug_regs_for_hw_breakpoints ( ) ; }
Physically install breakpoints, and make sure that modified memory is
 flushed on all CPUs.
Physically install breakpoints and make sure that modified memory is flushed on all CPUs .
/* Software breakpoints installation */