subsys/debug/gdb_server.c
/**
 * @brief delete a breakpoint or watchpoint from breakpoint list
 *
 * @return 0 on success, -1 if failed to remove breakpoint.
 */
@brief delete a breakpoint or watchpoint from breakpoint list
@return 0 on success, -1 if failed to remove breakpoint.
@brief delete a breakpoint or watchpoint from breakpoint list @return 0 on success - 1 if failed to remove breakpoint .
static int delete_bp(enum gdb_bp_type type, long addr, int len,
		     enum gdb_error_code *err)
{
	gdb_instr_t *bp_addr = (gdb_instr_t *)addr;
	if (type != GDB_SOFT_BP) {
		return remove_hw_bp(addr, type, len, err);
	}
	for (int ix = 0; ix < MAX_SW_BP; ix++) {
		if (bp_array[ix].valid && bp_array[ix].addr == bp_addr) {
			bp_array[ix].valid = 0;
			for (int jx = ix + 1; jx < MAX_SW_BP; jx++) {
				if (bp_array[jx].valid == 1) {
					bp_array[jx - 1] = bp_array[jx];
					bp_array[jx].valid = 0;
				} else {
					break;
				}
			}
			return 0;
		} else if (!bp_array[ix].valid) {
			break;
		}
	}
	*err = GDB_ERROR_INVALID_BP;
	return -1;
}
static int delete_bp ( enum gdb_bp_type type , long addr , int len , enum gdb_error_code * err ) { gdb_instr_t * bp_addr = ( gdb_instr_t * ) addr ; if ( type != GDB_SOFT_BP ) { return remove_hw_bp ( addr , type , len , err ) ; } for ( int ix = 0 ; ix < MAX_SW_BP ; ix ++ ) { if ( bp_array [ ix ] . valid && bp_array [ ix ] . addr == bp_addr ) { bp_array [ ix ] . valid = 0 ; for ( int jx = ix + 1 ; jx < MAX_SW_BP ; jx ++ ) { if ( bp_array [ jx ] . valid == 1 ) { bp_array [ jx - 1 ] = bp_array [ jx ] ; bp_array [ jx ] . valid = 0 ; } else { break ; } } return 0 ; } else if ( ! bp_array [ ix ] . valid ) { break ; } } * err = GDB_ERROR_INVALID_BP ; return -1 ; }
@brief delete a breakpoint or watchpoint from breakpoint list
 @return 0 on success, -1 if failed to remove breakpoint.
@brief delete a breakpoint or watchpoint from breakpoint list @return 0 on success - 1 if failed to remove breakpoint .
/*
			 * Make sure all valid entries are contiguous to speed
			 * up breakpoint table parsing.
			 */