[patch] Add "debug jit" for easier tracing of JIT support internals

Tom Tromey tromey@redhat.com
Thu Jan 6 19:45:00 GMT 2011


>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:

Pedro> An alternative I can think of, would be to come up with a GDB specific
Pedro> printf formatter for "replace by the value of the setting", and then
Pedro> instead of a code callback, we'd install a show string.  That is, 
Pedro> data driven instead of code driven, so instead, we'd register
Pedro> the command like:

Pedro>   add_setshow_zinteger_cmd ("jit", class_maintenance, &jit_debug, _("\
Pedro> Set JIT debugging."), _("\
Pedro> Show JIT debugging."), _("\
Pedro> When non-zero, JIT debugging is enabled."),
Pedro>                            NULL,
Pedro>                            _("\
Pedro> JIT debugging is: %V"),
Pedro>                            &setdebuglist, &showdebuglist);

Pedro> With %V being the new format string in question.

Pedro> We'd still need to write the "show" string, but it's more
Pedro> centralized and readable than putting it in a separate callback
Pedro> function.

Could we go even further, and just specify the name of the parameter and
then some generic documentation about it?  The set- and show-docs are
usually pretty useless.

Something like:

add_setshow_zinteger_cmd ("jit", class_maintenance, &jit_debug,
                          _("JIT debugging"),
                          _("When non-zero, JIT debugging is enabled."),
                          &setdebuglist, &showdebuglist);

Then:

(gdb) help show debug jit
Show the "JIT debugging" setting.
Usage: show debug jit
When non-zero, JIT debugging is enabled.
(gdb) help set debug jit
Set the "JIT debugging" setting.
Usage: set debug jit VALUE
When non-zero, JIT debugging is enabled.
(gdb) show debug jit
The "JIT debugging" setting is currently 0.

Tom



More information about the Gdb-patches mailing list