[Pdbg] [PATCH v2 11/39] gdbserver: reduce PR_INFO noise

Joel Stanley joel at jms.id.au
Tue May 3 17:00:45 AEST 2022


On Wed, 20 Apr 2022 at 06:50, Nicholas Piggin <npiggin at gmail.com> wrote:
>
> 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 at gmail.com>
> ---
>  src/pdbgproxy.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/pdbgproxy.c b/src/pdbgproxy.c
> index 4c6327fb..9e5e7d80 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");

We have a hexdump() in src/util, but it's probably not worth using it here.

Reviewed-by: Joel Stanley <joel at jms.id.au>

> +
>                 parse_buffer(buffer, nbytes, &fd);
>         }
>
> --
> 2.35.1
>
> --
> Pdbg mailing list
> Pdbg at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/pdbg


More information about the Pdbg mailing list