aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>2010-12-13 05:29:32 +0000
committerStan Shebs <shebs@codesourcery.com>2010-12-13 05:29:32 +0000
commit0914bcdbf6255fc4ac5f782b892f5280246045d6 (patch)
tree927258c9218370acbc834019dc2bfa4d2e6f519b /gdb/value.c
parent4610564552cf56d57952b34289f0e253a85e38fc (diff)
downloadgdb-0914bcdbf6255fc4ac5f782b892f5280246045d6.zip
gdb-0914bcdbf6255fc4ac5f782b892f5280246045d6.tar.gz
gdb-0914bcdbf6255fc4ac5f782b892f5280246045d6.tar.bz2
2010-12-12 Stan Shebs <stan@codesourcery.com>
* value.c (value_of_internalvar): Add case for trace state variables. * gdb.trace/tsv.exp: Test print command on trace state variables.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/value.c b/gdb/value.c
index aa8384c..c7de323 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -42,6 +42,8 @@
#include "python/python.h"
+#include "tracepoint.h"
+
/* Prototypes for exported functions. */
void _initialize_values (void);
@@ -1197,6 +1199,22 @@ struct value *
value_of_internalvar (struct gdbarch *gdbarch, struct internalvar *var)
{
struct value *val;
+ struct trace_state_variable *tsv;
+
+ /* If there is a trace state variable of the same name, assume that
+ is what we really want to see. */
+ tsv = find_trace_state_variable (var->name);
+ if (tsv)
+ {
+ tsv->value_known = target_get_trace_state_variable_value (tsv->number,
+ &(tsv->value));
+ if (tsv->value_known)
+ val = value_from_longest (builtin_type (gdbarch)->builtin_int64,
+ tsv->value);
+ else
+ val = allocate_value (builtin_type (gdbarch)->builtin_void);
+ return val;
+ }
switch (var->kind)
{