]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: add target_debug_printf and target_debug_printf_nofunc
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 19 Apr 2024 19:46:54 +0000 (15:46 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 19 Apr 2024 20:30:25 +0000 (16:30 -0400)
commitcb5dfff88ea6ed73b0222cfeeef97dc6d4ccf84f
tree28a0d29e3cf27cc5be7060a06f50d15eed1da40f
parent8a8b6c53e12c79abad6defd839ea3000a2cd2398
gdb: add target_debug_printf and target_debug_printf_nofunc

Add the `target_debug_printf` and `target_debug_printf_nofunc` macros
and use them when outputting debug messages depending on `targetdebug`.
I opted for `target_debug_printf_nofunc` to follow the current style
where the function name is already printed, along with the arguments.

Modify the debug printfs in the `debug_target` methods (generated by
`make-target-delegates.py`) to use `target_debug_printf_nofunc` as well.

This makes the "target" debug prints integrate nicely with the other
debug prints that use the "new" debug print system:

    [infrun] proceed: enter
      [infrun] follow_fork: enter
        [target] -> multi-thread->record_will_replay (...)
        [target] <- multi-thread->record_will_replay (-1, 0) = false
        [target] -> multi-thread->supports_multi_process (...)
        [target] <- multi-thread->supports_multi_process () = true
      [infrun] follow_fork: exit
      ...

Change-Id: Ide3c8c1b8a30e6d4c353a29cba911c7192de29ac
Approved-By: Tom Tromey <tom@tromey.com>
gdb/make-target-delegates.py
gdb/target-delegates.c
gdb/target.c