Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Stan Shebs <stan@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: tracing broken if target doesn't do disconnected tracing
Date: Wed, 07 Apr 2010 22:06:00 -0000	[thread overview]
Message-ID: <201004072306.17003.pedro@codesourcery.com> (raw)
In-Reply-To: <4BBCE927.3070401@codesourcery.com>

On Wednesday 07 April 2010 21:20:55, Stan Shebs wrote:
> >
> > Hmm, can you expand on what lameness you're referring to exactly?
> > Is it a technical limitation?
> >   
> 
> It's the requirement to describe the variable with a noun phrase like 
> "foo bar of baz", so that the output can be "foo bar of baz is on" etc.  
> For simple settings the algorithm is reasonable, but as the concept gets 
> more complicated, the phrasing gets more tortured.

I think you can already have what you want.  See how
the "show displaced-stepping", "show breakpoint always-inserted",
"show language" are implemented.  E.g.,

static void
show_can_use_displaced_stepping (struct ui_file *file, int from_tty,
				 struct cmd_list_element *c,
				 const char *value)
{
  if (can_use_displaced_stepping == can_use_displaced_stepping_auto)
    fprintf_filtered (file, _("\
Debugger's willingness to use displaced stepping to step over \
breakpoints is %s (currently %s).\n"),
		      value, non_stop ? "on" : "off");
  else
    fprintf_filtered (file, _("\
Debugger's willingness to use displaced stepping to step over \
breakpoints is %s.\n"), value);
}

So, here:

>  add_setshow_boolean_cmd ("disconnected-tracing", no_class,
>			   &disconnected_tracing, _("\
>Set whether tracing continues after GDB disconnects."), _("\
>Show whether tracing continues after GDB disconnects."), _("\
>Use this to continue a tracing run even if GDB disconnects\n\
>or detaches from the target.  You can reconnect later and look at\n\
>trace data collected in the meantime."),
>			   set_disconnected_tracing,
>			   NULL,
                                       ^^^^

this callback is NULL.  YOu can set to a callback that computes
the show string in response to "show disconnected-tracing".
In there you can use something like "target_can_use_disconnected_tracing()",
or "current_trace_status ()->circular" to do that "(currently foo)"/"(but
target is lame and doesn't support)" thing.

Does that help?

Actually, we should not be allowing new commands with that
callback as NULL.  Take a look at `deprecated_show_value_hack',
which is the default callback --- it's busted with i18n:

  /* Print doc minus "show" at start.  */
  print_doc_line (gdb_stdout, c->doc + 5);

This is PR8413 <http://sourceware.org/bugzilla/show_bug.cgi?id=8413>.

-- 
Pedro Alves


  reply	other threads:[~2010-04-07 22:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-05  0:01 Pedro Alves
2010-04-05  1:08 ` Stan Shebs
2010-04-05 11:04   ` Pedro Alves
2010-04-07  1:34     ` Stan Shebs
2010-04-07 11:40       ` Pedro Alves
2010-04-07 13:33         ` Stan Shebs
2010-04-07 13:47           ` Pedro Alves
2010-04-07 14:07           ` Pedro Alves
2010-04-07 20:21             ` Stan Shebs
2010-04-07 22:06               ` Pedro Alves [this message]
2010-04-07 13:35         ` Pedro Alves
2010-04-07 22:04           ` Stan Shebs
2010-04-08 17:25             ` Pedro Alves
2010-04-08 18:19               ` Stan Shebs
2010-04-08 18:32                 ` Pedro Alves
2010-04-08 19:10                   ` Stan Shebs
2010-04-09  3:10                     ` Stan Shebs

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=201004072306.17003.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=stan@codesourcery.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