diff mbox series

[v2,10/38] gdbserver: reduce PR_INFO noise

Message ID 20220329154931.493851-11-npiggin@gmail.com
State New
Headers show
Series gdbserver multi-threaded debugging and POWER9/10 support | expand

Commit Message

Nicholas Piggin March 29, 2022, 3:49 p.m. UTC
Printing the first byte of the received packet in hex on its own line is
not very useful and clutters debug output. We print the full received
packet anyway which is generally quite readable.

Remove the first byte info line, and replace it with a debug line that
contains the entire hex string as hex bytes.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 src/pdbgproxy.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/pdbgproxy.c b/src/pdbgproxy.c
index 4c6327f..9e5e7d8 100644
--- a/src/pdbgproxy.c
+++ b/src/pdbgproxy.c
@@ -396,9 +396,15 @@  static int read_from_client(int fd)
 		PR_INFO("0 bytes\n");
 		return -1;
 	} else {
+		int i;
+
 		buffer[nbytes] = '\0';
-		PR_INFO("%x\n", buffer[0]);
 		PR_INFO("Recv: %s\n", buffer);
+		pdbg_log(PDBG_DEBUG, " hex: ");
+		for (i = 0; i < nbytes; i++)
+			pdbg_log(PDBG_DEBUG, "%02x ", buffer[i]);
+		pdbg_log(PDBG_DEBUG, "\n");
+
 		parse_buffer(buffer, nbytes, &fd);
 	}