From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4325 invoked by alias); 15 Dec 2009 19:17:31 -0000 Received: (qmail 4314 invoked by uid 22791); 15 Dec 2009 19:17:30 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS 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; Tue, 15 Dec 2009 19:17:25 +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 nBFJHIXl022322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Dec 2009 14:17:18 -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 nBFJHHup014709; Tue, 15 Dec 2009 14:17:17 -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 nBFJHGXk017773; Tue, 15 Dec 2009 14:17:17 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 12013378286; Tue, 15 Dec 2009 12:17:16 -0700 (MST) From: Tom Tromey To: Stan Shebs Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Trace state variables References: <4B279456.1010508@codesourcery.com> Reply-To: tromey@redhat.com Date: Tue, 15 Dec 2009 19:17:00 -0000 In-Reply-To: <4B279456.1010508@codesourcery.com> (Stan Shebs's message of "Tue, 15 Dec 2009 05:51:18 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (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: 2009-12/txt/msg00194.txt.bz2 >>>>> "Stan" == Stan Shebs writes: Stan> Since internalvar handling has changed recently, I've left off the Stan> value.c bit to make "print $foo" work. Will this be forthcoming? Stan> + case BINOP_ASSIGN: It seems a little odd to add BINOP_ASSIGN but not BINOP_ASSIGN_MODIFY. Stan> extern int remote_supports_cond_tracepoints (void); Stan> + extern char *unpack_varlen_hex (char *buff, ULONGEST *result); It seems like this could be in a header somewhere. Stan> + /* The list of all trace state variables. We don't retain pointers to Stan> + any of these for any reason - API is by name or number only - so it Stan> + works to have a vector of objects. */ Stan> + Stan> + VEC(tsv_s) *tvariables; Stan> + Stan> + /* The next integer to assign to a variable. */ Stan> + Stan> + int next_tsv_number = 1; It seems like these, plus some of the new functions, could be static. It is hard to say for sure since I don't know what future patches might do. Stan> + void Stan> + trace_variable_command (char *args, int from_tty) Stan> + { [...] Stan> + /* All the possible valid arguments are expressions. */ Stan> + expr = parse_expression (args); Stan> + old_chain = make_cleanup (free_current_contents, &expr); I think set_cmd_completer (..., expression_completer) is probably in order, in the file's initialize function. Stan> + void Stan> + delete_trace_variable_command (char *args, int from_tty) It would be nice to have a completer function for this. Stan> + static void Stan> + tvariables_info (char *args, int from_tty) [...] Stan> + printf_filtered (_("Name\t\t Initial\tCurrent\n")); I think that brand-new formatted output should be done using the ui_out machinery. Is there some drawback to doing that? I really don't know... I would have expected ui_out to be used universally but instead it seems somewhat random, and I don't know why. (I assume that whoever was doing this transition ran out of steam... ?) Stan> + typedef struct trace_state_variable tsv_s; Stan> + DEF_VEC_O(tsv_s); AFAICT, this VEC is only used in a single .c file. It is better to put the DEF_VEC there, to avoid duplicating the static functions in other compilation units where they aren't needed. Tom