GDB: Added support for single step.

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

View File

@ -205,7 +205,8 @@ while (1) {
break;
}
break;
case 'z': /* remove HW breakpoint */
/* remove HW breakpoint */
case 'z':
switch (*request++) {
/* remove HW breakpoint */
case '1':
@ -238,6 +239,19 @@ while (1) {
break;
}
break;
/* Single step in the code */
case 's':
if (hex_to_int(&request, &addr))
sregs[DEBUG_PC] = addr;
/* leave debug just for one instruction */
sregs[ICOUNT] = 0xfffffffe;
sregs[ICOUNTLEVEL] = XCHAL_DEBUGLEVEL;
/* disable low level interrupts */
sregs[INTENABLE] &= ~DISABLE_LOWER_INTERRUPTS_MASK;
write_sr(ICOUNTLEVEL);
write_sr(ICOUNT);
write_sr(INTENABLE);
return;
default:
gdb_log_exception("Unknown GDB command.");
break;