linux-debuggers.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* kgdb replacing newline with CRLF in custom query response
@ 2024-11-07 22:23 Omar Sandoval
  2024-11-08  1:08 ` Doug Anderson
  0 siblings, 1 reply; 8+ messages in thread
From: Omar Sandoval @ 2024-11-07 22:23 UTC (permalink / raw)
  To: Jason Wessel, Daniel Thompson, Douglas Anderson
  Cc: Amal Raj T, Stephen Brennan, kgdb-bugreport, linux-serial,
	linux-debuggers

Hi everyone,

Amal is working on adding a custom query packet to kgdb for getting the
kernel's vmcoreinfo. The rationale and details are available here:
https://github.com/osandov/drgn/wiki/GDB-Remote-Protocol-proposal:-linux.vmcoreinfo-query-packet

vmcoreinfo is about 3kB, so we were hoping to avoid hex-encoding the
response and doubling the time it takes to transmit over a slow serial
connection. Instead, we were hoping to use the escaped binary format,
which escapes the characters #$}* and leaves other bytes untouched.

We ran into a problem, though: vmcoreinfo contains newline characters,
which the serial core replaces with CRLF; see commit c7d44a02ac60
("serial_core: Commonalize crlf when working w/ a non open console
port"). This effectively corrupts the data and causes a checksum
mismatch.

We'd love some input on how to work around this, especially from the
kgdb maintainers. Here are a few options, in descending order of my
preference:

1. Disable the LF -> CRLF replacement while sending binary data.
2. Escape the newlines using some other custom scheme.
3. Give up and hex-encode the response.

Any thoughts?

Thanks,
Omar

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-11-15 17:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07 22:23 kgdb replacing newline with CRLF in custom query response Omar Sandoval
2024-11-08  1:08 ` Doug Anderson
2024-11-08  1:13   ` Omar Sandoval
2024-11-08 15:31     ` Doug Anderson
2024-11-08 16:17       ` Omar Sandoval
2024-11-08 17:37         ` Doug Anderson
2024-11-15 14:49           ` Daniel Thompson
2024-11-15 17:57             ` Omar Sandoval

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).