From f38dcde0d80d2f4818b8f20067b8de5267c8ade6 Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Fri, 30 Dec 2016 21:14:50 +0000 Subject: [PATCH] Only read exception flag in gdb register read/write. (#85) The flag is 32 bits, and if we read 64/128 bits then we get fragments of S1 too and can accidentally send an error. Fixes #84. --- riscv/gdbserver.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/riscv/gdbserver.cc b/riscv/gdbserver.cc index 4303adf..7e83c49 100644 --- a/riscv/gdbserver.cc +++ b/riscv/gdbserver.cc @@ -648,7 +648,7 @@ class register_read_op_t : public operation_t case 1: { - unsigned result = gs.dr_read(SLOT_DATA_LAST); + unsigned result = gs.dr_read32(DEBUG_RAM_SIZE / 4 - 1); if (result) { gs.send_packet("E03"); return true; @@ -728,7 +728,7 @@ class register_write_op_t : public operation_t case 1: { - unsigned result = gs.dr_read(SLOT_DATA_LAST); + unsigned result = gs.dr_read32(DEBUG_RAM_SIZE / 4 - 1); if (result) { gs.send_packet("E03"); return true; -- 2.30.2