From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4842 invoked by alias); 15 Dec 2009 15:53:30 -0000 Received: (qmail 4571 invoked by uid 22791); 15 Dec 2009 15:53:26 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Dec 2009 15:53:19 +0000 Received: from eliz by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NKZi9-0000aZ-2G; Tue, 15 Dec 2009 10:53:17 -0500 From: Eli Zaretskii To: Stan Shebs CC: gdb-patches@sourceware.org In-reply-to: <4B279456.1010508@codesourcery.com> (message from Stan Shebs on Tue, 15 Dec 2009 05:51:18 -0800) Subject: Re: [PATCH] Trace state variables Reply-to: Eli Zaretskii References: <4B279456.1010508@codesourcery.com> Message-Id: Date: Tue, 15 Dec 2009 15:53:00 -0000 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: 2009-12/txt/msg00192.txt.bz2 > Date: Tue, 15 Dec 2009 05:51:18 -0800 > From: Stan Shebs > > One of our tracepoint enhancements is to add the notion of a "trace > state variable", which is a GDB-defined piece of data managed by the > tracepoint agent on the target; one could think of it as a target-side > convenience variable. Thanks. > In keeping with their convenience-like nature, they are introduced > with a dollar sign But the code seems to allow with or without the $, right? Like here: > + /* Be relaxed about the special character. */ > + if (*name == '$') > + ++name; A few comments: > + /* Make sure the tsv number is in range. */ > + if (num < 0 || num > 0xffff) > + error (_("GDB bug: ax-general.c (ax_tsv): variable number out of range")); Should this be internal_error instead? > + warning (_("No trace variable named \"$%s\", not deleting"), name); The "not deleting" part seems unnecessary. > + printf_filtered (" "); > + else > + /* It is not meaningful to ask about the value. */ > + printf_filtered (" "); No translations for these two? > Index: doc/agentexpr.texi > =================================================================== > RCS file: /cvs/src/src/gdb/doc/agentexpr.texi,v > retrieving revision 1.9 > diff -p -r1.9 agentexpr.texi > *** doc/agentexpr.texi 11 Nov 2009 15:08:50 -0000 1.9 > --- doc/agentexpr.texi 15 Dec 2009 13:28:33 -0000 This part is fine. > + @node Trace State Variables > + @subsection Trace State Variables > + > + A @dfn{trace state variable} is a special type of variable that is > + created and managed by target-side code. The syntax is the same as This introduces a new terminology, so please add an index entry for it. > + but they are stored on the target. They must be created explicitly, ^^ Two spaces between sentences, please (here and elsewhere). > + while the trace experiment is running. Trace state variables share > + the same namespace as other ``$'' variables, which means that you > + cannot have trace state variables with names like @code{$23} or > + @code{$pc}, nor can you have a trace state variable and a convenience > + variable with the same name. I would suggest here an index entry like @cindex convenience variables, and trace state variables > + @item tvariable $@var{name} [ = @var{expression} ] > + @kindex tvariable > + @cindex trace state variable This @cindex entry should be moved to the beginning of the subsection, and will then serve as the indexing of the term "trace state variable" that this section introduces. > + The @code{tvariable} command creates a new trace state variable named > + @code{$}@var{name} ^^^^^^^^^^^^^^^^^^ @code{$@var{name}} > + A second @code{tvariable} > + command with the same name assigns a new value to the variable. I don't understand this sentence: what ``second command''? what ``new value''? Did you mean to say that each tvariable command overwrites the previous value by a new one? > + @item info tvariables > + @kindex tvariables We already have "@kindex tvariable" a few lines above, so this @kindex is not useful. Suggest to remove it, or replace with @kindex info tvariables > + List all the trace state variables along with their initial values. ^^^^^^^^^^^^^^^^^^^^ But in reality the current values are displayed as well, right? > + @item QTDV:@var{n}:@var{value} Don't we have index entries for all the packets we support? > + @item V@var{value} > + The value of the variable is @var{value}. This will be the current > + value of the variable if the user is examining a running target, or a > + saved value if the variable was collected in the trace frame that the > + user is looking at. Note that multiple requests may result in different > + reply values, such as for variables like @code{$trace_timestamp} that are > + computed by the target program. What is this $trace_timestamp variable mentioned in the last sentence? I thought trace state variables need to be declared before they can be used, so how come we evidently have special internally generated variables with magic features? What am I missing here?