diff --git a/packages/gdb/8.3.1/0006-fix-remote-debug.patch b/packages/gdb/8.3.1/0006-fix-remote-debug.patch new file mode 100644 index 0000000000..cb3e94826a --- /dev/null +++ b/packages/gdb/8.3.1/0006-fix-remote-debug.patch @@ -0,0 +1,27 @@ +Index: gdb-8.3.1/gdb/remote.c +=================================================================== +--- gdb-8.3.1.orig/gdb/remote.c ++++ gdb-8.3.1/gdb/remote.c +@@ -8035,11 +8035,17 @@ remote_target::process_g_packet (struct + buf_len = strlen (rs->buf.data ()); + + /* Further sanity checks, with knowledge of the architecture. */ +- if (buf_len > 2 * rsa->sizeof_g_packet) +- error (_("Remote 'g' packet reply is too long (expected %ld bytes, got %d " +- "bytes): %s"), +- rsa->sizeof_g_packet, buf_len / 2, +- rs->buf.data ()); ++ if(buf_len > 2 * rsa->sizeof_g_packet) { ++ rsa->sizeof_g_packet = buf_len; ++ for(i = 0; i < gdbarch_num_regs(gdbarch); i++){ ++ if(rsa->regs[i].pnum == -1) ++ continue; ++ if(rsa->regs[i].offset >= rsa->sizeof_g_packet) ++ rsa->regs[i].in_g_packet = 0; ++ else ++ rsa->regs[i].in_g_packet = 1; ++ } ++ } + + /* Save the size of the packet sent to us by the target. It is used + as a heuristic when determining the max size of packets that the