Daniel Thompson <daniel.thomp...@linaro.org> 于2021年1月26日周二 下午6:03写道:

>
> I'd prefer this to be:
>
>   kdb_dbg_printf(AR, "symname=%s, symtab=%px\n", symname
>
> That way the other examples of the if (KDB_DEBUG(xxx)) kdb_printf(...)
> pattern could adopt the same macro.
>
>
> Daniel.
>

Thanks.I've been thinking about that.There are several patterns to deal
with.

0:

kdb_printf("...",...);

which is the normal one.

1:

kdb_printf("%s: "...,__func__,...)

Maybe we could improve '1' to this :

#define kdb_func_printf(format, args...) \
  kdb_printf("%s: " format, __func__, ## args)


2:
if(KDB_DEBUG(AR))
kdb_printf("%s "...,__func__,...);

we could improve '2' to this :
#define kdb_ardbg_printf(format, mask, args...) \
  do { \
  if (KDB_DEBUG(mask)) \
  kdb_func_printf(format, ## args); \
  } while (0)

---
Stephen.

_______________________________________________
Kgdb-bugreport mailing list
Kgdb-bugreport@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to