Re: [PATCH] gdb: add linux_nat_debug_printf macro

Simon Marchi
2020-07-13T14:38:20Z

On 2020-07-13 10:32 a.m., Joel Brobecker wrote:
> I skimmed through the patch, and it looked good to me.
>
> Thanks again for doing that. That's a nice improvement.
>
> Thinking out loud (and certainly not a suggestion or request that
> you take care of the implementation): I'm wondering if we should be
> thinking about generalizing this approach, somehow. For instance,
> if we a function that took not just a func name, but also the name
> of the unit:
>
> unit_debug_vprintf (const char *module_name, const char *func_name,
> const char *fmt, ...)
>
> ... or perhaps more generally:
>
> unit_debug_vprintf (const char *label, const char *func_name,
> const char *fmt, ...)
>
> ... then all modules would have to do to have consistent logging
> is to define one macro.
>
> --
> Joel
>

Yes, if people like the format I'd be open to changing other "modules" to
use it, and having a generic function to ensure the same formatting is used
everywhere would be the logical thing to do.

Simon