From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13935 invoked by alias); 5 Jan 2011 23:34:22 -0000 Received: (qmail 13778 invoked by uid 22791); 5 Jan 2011 23:34:22 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,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, 05 Jan 2011 23:34:16 +0000 Received: (qmail 4238 invoked from network); 5 Jan 2011 23:34:15 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Jan 2011 23:34:15 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch] Add "debug jit" for easier tracing of JIT support internals Date: Wed, 05 Jan 2011 23:34:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.33-29-realtime; KDE/4.4.5; x86_64; ; ) Cc: Doug Evans , Paul Pluzhnikov References: <20110105193621.A8CBF190B3A@elbrus2.mtv.corp.google.com> <201101052257.30806.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101052334.13475.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: 2011-01/txt/msg00101.txt.bz2 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