This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Add "debug jit" for easier tracing of JIT support internals
On Wednesday 05 January 2011 23:26:22, Doug Evans wrote:
> > Until and if we find a better way, an implemented show callback
> > should be a requirement for all new commands.
>
> It feels like if some better way is that hard, we're not very clever. :-)
An alternative I can think of, would be to come up with a GDB specific
printf formatter for "replace by the value of the setting", and then
instead of a code callback, we'd install a show string. That is,
data driven instead of code driven, so instead, we'd register
the command like:
add_setshow_zinteger_cmd ("jit", class_maintenance, &jit_debug, _("\
Set JIT debugging."), _("\
Show JIT debugging."), _("\
When non-zero, JIT debugging is enabled."),
NULL,
_("\
JIT debugging is: %V"),
&setdebuglist, &showdebuglist);
With %V being the new format string in question.
We'd still need to write the "show" string, but it's more
centralized and readable than putting it in a separate callback
function.
--
Pedro Alves