From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15786 invoked by alias); 7 Apr 2010 22:06:26 -0000 Received: (qmail 15774 invoked by uid 22791); 7 Apr 2010 22:06:25 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Apr 2010 22:06:21 +0000 Received: (qmail 15736 invoked from network); 7 Apr 2010 22:06:19 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 7 Apr 2010 22:06:19 -0000 From: Pedro Alves To: Stan Shebs Subject: Re: tracing broken if target doesn't do disconnected tracing Date: Wed, 07 Apr 2010 22:06:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <201004050101.02067.pedro@codesourcery.com> <201004071507.18770.pedro@codesourcery.com> <4BBCE927.3070401@codesourcery.com> In-Reply-To: <4BBCE927.3070401@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201004072306.17003.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00166.txt.bz2 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 . -- Pedro Alves