Re: [RFC PATCH] gdb: add linux_nat_debug_printf macro

Tom Tromey
2020-07-12T17:11:15Z

>>>>> "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