From 0914bcdbf6255fc4ac5f782b892f5280246045d6 Mon Sep 17 00:00:00 2001 From: Stan Shebs Date: Mon, 13 Dec 2010 05:29:32 +0000 Subject: 2010-12-12 Stan Shebs * value.c (value_of_internalvar): Add case for trace state variables. * gdb.trace/tsv.exp: Test print command on trace state variables. --- gdb/value.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gdb/value.c') 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) { -- cgit v1.1