Skip to content

Instantly share code, notes, and snippets.

@BohuTANG
Created March 10, 2012 09:32
Show Gist options
  • Save BohuTANG/2010977 to your computer and use it in GitHub Desktop.
Save BohuTANG/2010977 to your computer and use it in GitHub Desktop.
modify the gdb's remote.c to support long-buffer output when debug linux kernel
change:
if (buf_len > 2 * rsa->sizeof_g_packet)
error (_(“Remote ‘g’ packet reply is too long: %s”), rs->buf);
to:
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment