src/avr/avr_gdb.c
/*
 * "Unescape" RSP binary data.
 * '#', '$' and '}' are escaped by preceding them by '}' and oring with 0x20.
 * This function reverses that, modifying the data in place.
 *
 * @param[in] data The array of bytes to convert
 * @para[in] len The number of bytes to be converted
 * @return The number of bytes AFTER conversion
 */
"Unescape" RSP binary data.

@param[in] data The array of bytes to convert
@para[in] len The number of bytes to be converted
@return The number of bytes AFTER conversion
" Unescape " RSP binary data . @param [ in ] data The array of bytes to convert @para [ in ] len The number of bytes to be converted @return The number of bytes AFTER conversion
static unsigned long rsp_unescape(char *data, unsigned long len)
{
	unsigned long from_off = 0;		
	unsigned long to_off = 0;		
	while (from_off < len) {
		if (data[from_off] == '}') {
			from_off++;
			data[to_off] = data[from_off] ^ 0x20;
		} else {
			data[to_off] = data[from_off];
		}
		from_off++;
		to_off++;
	}
	return  to_off;
}
static unsigned long rsp_unescape ( char * data , unsigned long len ) { unsigned long from_off = 0 ; unsigned long to_off = 0 ; while ( from_off < len ) { if ( data [ from_off ] == ' ' ) { from_off ++ ; data [ to_off ] = data [ from_off ] ^ 0x20 ; } else { data [ to_off ] = data [ from_off ] ; } from_off ++ ; to_off ++ ; } return to_off ; }
"Unescape" RSP binary data.
" Unescape " RSP binary data .
/* Offset to source char */ /* Offset to dest char */ /* Is it escaped? */