Add detail to `wrong register size` error. 77/4577/3
authorTim Newsome <tim@sifive.com>
Mon, 25 Jun 2018 20:44:01 +0000 (13:44 -0700)
committerMatthias Welwarsky <matthias@welwarsky.de>
Wed, 8 Aug 2018 19:30:09 +0000 (20:30 +0100)
Signed-off-by: Tim Newsome <tim@sifive.com>
Change-Id: Id31499c94b539969970251145e42c89c943fd87c
Reviewed-on: http://openocd.zylin.com/4577
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/server/gdb_server.c

index 2270aff..69afb2f 100644 (file)
@@ -1360,7 +1360,8 @@ static int gdb_set_register_packet(struct connection *connection,
        int chars = (DIV_ROUND_UP(reg_list[reg_num]->size, 8) * 2);
 
        if ((unsigned int)chars != strlen(separator + 1)) {
-               LOG_ERROR("gdb sent a packet with wrong register size");
+               LOG_ERROR("gdb sent %zu bits for a %d-bit register (%s)",
+                               strlen(separator + 1) * 4, chars * 4, reg_list[reg_num]->name);
                free(bin_buf);
                return ERROR_SERVER_REMOTE_CLOSED;
        }