Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, Doug Evans <dje@google.com>,
	       Paul Pluzhnikov <ppluzhnikov@google.com>
Subject: Re: [patch] Add "debug jit" for easier tracing of JIT support internals
Date: Thu, 06 Jan 2011 19:45:00 -0000	[thread overview]
Message-ID: <m3hbdlrf46.fsf@fleche.redhat.com> (raw)
In-Reply-To: <201101052334.13475.pedro@codesourcery.com> (Pedro Alves's	message of "Wed, 5 Jan 2011 23:33:48 +0000")

>>>>> "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


  reply	other threads:[~2011-01-06 19:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-05 19:36 Paul Pluzhnikov
2011-01-05 20:02 ` Doug Evans
2011-01-05 22:57   ` Pedro Alves
2011-01-05 23:16     ` Paul Pluzhnikov
2011-01-05 23:28       ` Pedro Alves
2011-01-05 23:49         ` Paul Pluzhnikov
2011-01-06  0:45           ` Pedro Alves
2011-01-06  1:09             ` Paul Pluzhnikov
2011-01-06  4:14               ` Eli Zaretskii
2011-01-05 23:26     ` Doug Evans
2011-01-05 23:34       ` Pedro Alves
2011-01-06 19:45         ` Tom Tromey [this message]
2011-01-06 19:52           ` Paul Pluzhnikov
2011-01-05 20:57 ` Eli Zaretskii
2011-01-05 21:53   ` Paul Pluzhnikov
2011-01-05 22:51     ` Pedro Alves
2011-01-06  4:00     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3hbdlrf46.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=ppluzhnikov@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox