From 02ef4d5392cda00de92926639d1e73ba56ead562 Mon Sep 17 00:00:00 2001 From: Marcin Rajwa Date: Tue, 12 Feb 2019 20:04:26 +0100 Subject: [PATCH] GDB: fix "step" followed by "continue" issue Signed-off-by: Marcin Rajwa --- src/arch/xtensa/gdb/debugexception.S | 4 ++++ src/gdb/gdb.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/arch/xtensa/gdb/debugexception.S b/src/arch/xtensa/gdb/debugexception.S index 4f6ac6039..3883ec7f7 100644 --- a/src/arch/xtensa/gdb/debugexception.S +++ b/src/arch/xtensa/gdb/debugexception.S @@ -154,6 +154,10 @@ DebugExceptionEntry: wsr a2, PS rsync + /* reset icountlevel - essential when coming back from single step */ + movi a2, 0x00 + wsr a2, ICOUNTLEVEL + movi a4, gdb_handle_exception callx4 a4 diff --git a/src/gdb/gdb.c b/src/gdb/gdb.c index 210872db8..44c2ffbc2 100644 --- a/src/gdb/gdb.c +++ b/src/gdb/gdb.c @@ -279,7 +279,7 @@ while (1) { mem_to_hex(sregs + addr, remcom_out_buffer, 4); } else if (addr >= 0x300 && addr < 0x400) { strcpy((char *)remcom_out_buffer, - "out of scope"); + "deadbabe"); } else { /* unexpected register number */ strcpy((char *)remcom_out_buffer, "E00"); } @@ -469,7 +469,7 @@ static void read_sr(int sr) : "=r"(val) : "r"(sr) : "a3", "memory"); - sregs[sr] = val; + //sregs[sr] = val; #endif }