From 210d50a01fed904e337755041f66b2816141f406 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Fri, 28 Oct 2016 13:30:43 -0700 Subject: [PATCH] Fix error message. It was erroneously complaining that gdb sent too much data even when it wasn't. --- riscv/gdbserver.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/riscv/gdbserver.cc b/riscv/gdbserver.cc index 16f59b2..dc60a3e 100644 --- a/riscv/gdbserver.cc +++ b/riscv/gdbserver.cc @@ -1712,10 +1712,10 @@ uint64_t gdbserver_t::consume_hex_number_le( else shift -= 4; } - if (shift >= xlen) { + if (shift > (xlen+4)) { fprintf(stderr, - "gdb sent too many data bytes. That means it thinks XLEN is greater than %d.\n" - "To fix that, tell gdb: set arch riscv:rv%d\n", + "gdb sent too many data bytes. That means it thinks XLEN is greater " + "than %d.\nTo fix that, tell gdb: set arch riscv:rv%d\n", xlen, xlen); } return value; -- 2.30.2