gdb: use infrun_debug_printf in print_target_wait_results
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 4 Jan 2021 16:56:10 +0000 (11:56 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Mon, 4 Jan 2021 17:00:25 +0000 (12:00 -0500)
commite71daf80d338e536597fa1c3cd1029aadbaa2a67
tree7f47bbfd089a5274f2e67fca6718681665982915
parent335709bc5a6dc4778e9931cfa0ed55cb0c516d7a
gdb: use infrun_debug_printf in print_target_wait_results

The code in print_target_wait_results uses a single call to debug_printf
in order to make sure a single timestamp is emitted, despite printing
multiple lines.  The result is:

    941502.043284 [infrun] target_wait (-1.0.0, status) =
    [infrun]   649832.649832.0 [process 649832],
    [infrun]   status->kind = stopped, signal = GDB_SIGNAL_TRAP

I find this decision a bit counter productive, because it messes up the
alignment of the three lines.  We don't care that three (slightly
different) timestamps are printed.

I suggest to change this function to use infrun_debug_printf, with this
result:

    941601.425771 [infrun] print_target_wait_results: target_wait (-1.0.0 [process -1], status) =
    941601.425824 [infrun] print_target_wait_results:   651481.651481.0 [process 651481],
    941601.425867 [infrun] print_target_wait_results:   status->kind = stopped, signal = GDB_SIGNAL_TRAP

Note that the current code only prints the waiton_ptid as a string
between square brackets if pid != -1.  I don't think this complexity is
needed in a debug print.  I made it so it's always printed, which I
think results in a much simpler function.

gdb/ChangeLog:

* infrun.c (print_target_wait_results): Use infrun_debug_printf.

Change-Id: I817bd10286b8e641a6c751ac3a1bd1ddf9b18ce0
gdb/ChangeLog
gdb/infrun.c
This page took 0.025185 seconds and 4 git commands to generate.