Re: [PATCH] gdb: add linux_nat_debug_printf macro

Gary Benson
2020-07-13T14:56:31Z

Simon Marchi wrote:
> 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.
>
> 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.

I like it :)

Cheers,
Gary

--
Gary Benson - he / him / his
Principal Software Engineer, Red Hat