GDB: Added the possibility to remove breakpoints.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This commit is contained in:
Marcin Rajwa 2019-02-05 14:46:29 +01:00 committed by Janusz Jankowski
parent cbd5b297a9
commit 031fc9fc11
1 changed files with 33 additions and 0 deletions

View File

@ -205,6 +205,39 @@ while (1) {
break; break;
} }
break; break;
case 'z': /* remove HW breakpoint */
switch (*request++) {
/* remove HW breakpoint */
case '1':
if (*request++ == ',' && hex_to_int(&request, &addr) &&
*request++ == ',' && hex_to_int(&request, &length)) {
for (i = 0; i < XCHAL_NUM_IBREAK; ++i) {
if (sregs[IBREAKENABLE] & (1 << i) &&
sregs[IBREAKA + i] == addr) {
sregs[IBREAKENABLE]
&= ~(1 << i);
write_sr(IBREAKENABLE);
break;
}
}
if (i == XCHAL_NUM_IBREAK)
strcpy((char *)remcom_out_buffer,
"E02");
else
strcpy((char *)remcom_out_buffer, "OK");
} else {
strcpy((char *)remcom_out_buffer, "E01");
}
break;
/* SW breakpoints */
default:
/* send empty response to indicate thet SW breakpoints
* are not supported
*/
strcpy((char *)remcom_out_buffer, "");
break;
}
break;
default: default:
gdb_log_exception("Unknown GDB command."); gdb_log_exception("Unknown GDB command.");
break; break;