From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2877 invoked by alias); 6 Jan 2011 19:45:17 -0000 Received: (qmail 2868 invoked by uid 22791); 6 Jan 2011 19:45:17 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Jan 2011 19:45:11 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p06Jj0l8006538 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 Jan 2011 14:45:01 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p06Jj0eC009058; Thu, 6 Jan 2011 14:45:00 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p06Jixc8029240; Thu, 6 Jan 2011 14:44:59 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 3FB6D3784A7; Thu, 6 Jan 2011 12:44:58 -0700 (MST) From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org, Doug Evans , Paul Pluzhnikov Subject: Re: [patch] Add "debug jit" for easier tracing of JIT support internals References: <20110105193621.A8CBF190B3A@elbrus2.mtv.corp.google.com> <201101052257.30806.pedro@codesourcery.com> <201101052334.13475.pedro@codesourcery.com> Date: Thu, 06 Jan 2011 19:45:00 -0000 In-Reply-To: <201101052334.13475.pedro@codesourcery.com> (Pedro Alves's message of "Wed, 5 Jan 2011 23:33:48 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00138.txt.bz2 >>>>> "Pedro" == Pedro Alves 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