Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Stan Shebs <stan@codesourcery.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Stan Shebs <stan@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Trace state variables
Date: Tue, 15 Dec 2009 19:04:00 -0000	[thread overview]
Message-ID: <4B27DDCF.9050106@codesourcery.com> (raw)
In-Reply-To: <E1NKZi9-0000aZ-2G@fencepost.gnu.org>

Eli Zaretskii wrote:
>> Date: Tue, 15 Dec 2009 05:51:18 -0800
>> From: Stan Shebs <stan@codesourcery.com>
>>
>> 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;
>>     
I was thinking to let internal API work or without, for flexibility, but 
this routine is only called in one place, so I'll just make it 
consistently require.
>
> 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?
>   
Yep.
>   
>> +   warning (_("No trace variable named \"$%s\", not deleting"), name);
>>     
>
> The "not deleting" part seems unnecessary.
>   
I suppose so.  I always like to have warnings say what GDB is going to 
do with the situation, even if it seems somewhat obvious to us, because 
it may not be as obvious to the user (after all, they're getting a 
warning because things are not going as expected).
>> + 	printf_filtered ("  <unknown>");
>> +       else
>> + 	/* It is not meaningful to ask about the value.  */
>> + 	printf_filtered ("  <undefined>");
>>     
>
> No translations for these two?
>
>   
Oversight.
>> +                                           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?
>   
Yeah, I'll improve the phrasing.
>> + List all the trace state variables along with their initial values.
>>     
>                                                   ^^^^^^^^^^^^^^^^^^^^
> But in reality the current values are displayed as well, right?
>   
Yep.
>> + @item QTDV:@var{n}:@var{value}
>>     
>
> Don't we have index entries for all the packets we support?
>   
Excellent idea, I should do that. :-)
>> + @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?
>
>   
Oops, a communique from the future. :-) An upcoming patch will add the 
capability for a target to define its own builtin
variables, whose definitions are uploaded upon connection.

Stan



  reply	other threads:[~2009-12-15 19:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 13:51 Stan Shebs
2009-12-15 15:53 ` Eli Zaretskii
2009-12-15 19:04   ` Stan Shebs [this message]
2009-12-15 19:17 ` Tom Tromey
2009-12-18 20:03   ` Stan Shebs
2009-12-18 20:47     ` Tom Tromey
2009-12-29 17:21 ` Stan Shebs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B27DDCF.9050106@codesourcery.com \
    --to=stan@codesourcery.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox