This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Print trace state variables
- From: Tom Tromey <tromey at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Stan Shebs <stan at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Tue, 14 Dec 2010 09:13:14 -0700
- Subject: Re: [PATCH] Print trace state variables
- References: <4D015A4A.7040500@codesourcery.com> <20101211055510.GE2596@adacore.com>
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> I think a cleaner way of doing this would be to create a new OP_ enum
Joel> for tracepoint variables. We'd then add handling for it in
Joel> write_dollar_variable, as well as in the expression evaluator.
FWIW, I mildly prefer the current approach. Using a new OP_ means that
the variable is fixed at expression-parse time; but there doesn't seem
to be a compelling need to make this limitation. In fact, it seems like
it could be confusing... breakpoint conditions entered at different
times would refer to different variables (some hidden!), or re-parsing
an expression might resolve the variable differently.
Joel> Another potential issue to consider is precedence: If the user had
Joel> already defined an internal variable called "VAR", and then creates
Joel> a tracepoint variable with the same name, which one should we print
Joel> when he write "$VAR"? With your proposal, the tracepoint variable
Joel> hides the internal variable, right?
The docs say:
Trace state variables share the same
namespace as other "$" variables, which means that you cannot have
trace state variables with names like `$23' or `$pc', nor can you have
a trace state variable and a convenience variable with the same name.
Maybe this could be enforced? Or is that not possible?
Tom