From: Brian Campbell Date: Fri, 30 Dec 2016 21:14:50 +0000 (+0000) Subject: Only read exception flag in gdb register read/write. (#85) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f38dcde0d80d2f4818b8f20067b8de5267c8ade6;p=riscv-isa-sim.git 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. --- 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;