[RFC PATCH] gdb: add linux_nat_debug_printf macro
Tom Tromey
tom@tromey.com
Sun Jul 12 17:11:12 GMT 2020
>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
Simon> To address both of these issues, I suggest adding this macro for
Simon> printing debug statements, which automatically includes the function
Simon> name. It also includes the `[linux-nat]` prefix to clarify which part
Simon> of GDB printed this (I think that ideally, all debug prints would
Simon> include such a tag).
Yeah. After seeing your patch I think all the debug prints should be
done this way.
Simon> The `__func__` magic symbol is used to get the function name.
Simon> Unfortunately, in the case of methods, it only contains the method name,
We could check for GCC and use __PRETTY_FUNCTION__, though that is the
full signature, so it might be pretty long.
Tom
More information about the Gdb-patches
mailing list