aboutsummaryrefslogtreecommitdiff
path: root/gdb/make-target-delegates.py
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2024-04-19 15:46:54 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2024-04-19 16:30:25 -0400
commitcb5dfff88ea6ed73b0222cfeeef97dc6d4ccf84f (patch)
tree28a0d29e3cf27cc5be7060a06f50d15eed1da40f /gdb/make-target-delegates.py
parent8a8b6c53e12c79abad6defd839ea3000a2cd2398 (diff)
downloadgdb-cb5dfff88ea6ed73b0222cfeeef97dc6d4ccf84f.zip
gdb-cb5dfff88ea6ed73b0222cfeeef97dc6d4ccf84f.tar.gz
gdb-cb5dfff88ea6ed73b0222cfeeef97dc6d4ccf84f.tar.bz2
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>
Diffstat (limited to 'gdb/make-target-delegates.py')
-rwxr-xr-xgdb/make-target-delegates.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/gdb/make-target-delegates.py b/gdb/make-target-delegates.py
index f6f2bf0..bfcf7fa 100755
--- a/gdb/make-target-delegates.py
+++ b/gdb/make-target-delegates.py
@@ -274,9 +274,7 @@ def write_debugmethod(
debugname = "debug_target::" + name
names = write_function_header(f, False, debugname, return_type, argtypes)
print(
- ' gdb_printf (gdb_stdlog, "-> %s->'
- + name
- + ' (...)\\n", this->beneath ()->shortname ());',
+ f' target_debug_printf_nofunc ("-> %s->{name} (...)", this->beneath ()->shortname ());',
file=f,
)
@@ -311,11 +309,8 @@ def write_debugmethod(
ret = ""
print(
- (
- " gdb_printf (gdb_stdlog,\n"
- '\t "<- %s->{name} ({args_fmt}){ret_fmt}\\n",\n'
- "\t this->beneath ()->shortname (){args}{ret});"
- ).format(name=name, args_fmt=args_fmt, args=args, ret_fmt=ret_fmt, ret=ret),
+ f' target_debug_printf_nofunc ("<- %s->{name} ({args_fmt}){ret_fmt}",\n'
+ f"\t this->beneath ()->shortname (){args}{ret});",
file=f,
)