]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbserver: allow suppressing the next putpkt remote-debug log
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 19 Dec 2024 11:31:50 +0000 (12:31 +0100)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 19 Dec 2024 11:31:50 +0000 (12:31 +0100)
commit792b26bb0ce2fce17bab6dc97407aaae12c2276f
tree8be5cf35d043984e72438487577919bf2eb28723
parent53a7b478f54fc4150bc97f7af2b8d36bccd61b71
gdbserver: allow suppressing the next putpkt remote-debug log

When started with the --debug=remote flag, gdbserver enables the debug
logs for the received and sent remote packets.  If the packet contents
are too long or contain verbatim binary data, printing the contents
may create noise in the logs or even distortion in the terminal output.

Introduce a function, `suppress_next_putpkt_log`, that allows omitting
the contents of a sent package in the logs.  This can be useful when a
certain packet handler knows that it is sending binary data.

My first attempt was to implement this mechanism by passing an extra
parameter to putpt_binary_1 that could be controlled by the caller,
putpkt_binary or putpkt.  However, all qxfer handlers, regardless of
whether they send binary or ascii data, cause the data to be sent via
putpkt_binary. Hence, the solution was going to be either too
suppressive or too intrusive.  I opted for the approach where a package
handler would suppress the log explicitly.

Approved-By: Tom Tromey <tom@tromey.com>
gdbserver/debug.cc
gdbserver/debug.h
gdbserver/remote-utils.cc