Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010 Free Software Foundation, Inc.
+ 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GDB.
#include "python/python.h"
+#include "tracepoint.h"
+
/* Prototypes for exported functions. */
void _initialize_values (void);
if (!value->optimized_out)
return 0;
if (value->lval != lval_computed
- || !value->location.computed.funcs->check_validity)
+ || !value->location.computed.funcs->check_any_valid)
return 1;
return !value->location.computed.funcs->check_any_valid (value);
}
length);
}
+int
+value_bits_synthetic_pointer (const struct value *value,
+ int offset, int length)
+{
+ if (value == NULL || value->lval != lval_computed
+ || !value->location.computed.funcs->check_synthetic_pointer)
+ return 0;
+ return value->location.computed.funcs->check_synthetic_pointer (value,
+ offset,
+ length);
+}
+
int
value_embedded_offset (struct value *value)
{
/* Now absnum is always absolute and origin zero. */
chunk = value_history_chain;
- for (i = (value_history_count - 1) / VALUE_HISTORY_CHUNK - absnum / VALUE_HISTORY_CHUNK;
+ for (i = (value_history_count - 1) / VALUE_HISTORY_CHUNK
+ - absnum / VALUE_HISTORY_CHUNK;
i > 0; i--)
chunk = chunk->next;
static struct internalvar *internalvars;
-/* If the variable does not already exist create it and give it the value given.
- If no value is given then the default is zero. */
+/* If the variable does not already exist create it and give it the
+ value given. If no value is given then the default is zero. */
static void
init_if_undefined_command (char* args, int from_tty)
{
/* Extract the variable from the parsed expression.
In the case of an assign the lvalue will be in elts[1] and elts[2]. */
if (expr->elts[1].opcode != OP_INTERNALVAR)
- error (_("The first parameter to init-if-undefined should be a GDB variable."));
+ error (_("The first parameter to init-if-undefined "
+ "should be a GDB variable."));
intvar = expr->elts[2].internalvar;
/* Only evaluate the expression if the lvalue is void.
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)
{
printf_filtered (("\n"));
}
if (!varseen)
- printf_unfiltered (_("\
-No debugger convenience variables now defined.\n\
-Convenience variables have names starting with \"$\";\n\
-use \"set\" as in \"set $foo = 5\" to define them.\n"));
+ printf_unfiltered (_("No debugger convenience variables now defined.\n"
+ "Convenience variables have "
+ "names starting with \"$\";\n"
+ "use \"set\" as in \"set "
+ "$foo = 5\" to define them.\n"));
}
\f
/* Extract a value as a C number (either long or double).
*/
struct value *
-value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *type,
+value_fn_field (struct value **arg1p, struct fn_field *f,
+ int j, struct type *type,
int offset)
{
struct value *v;
break;
default:
- error (_("\
-Unexpected type (%d) encountered for unsigned integer constant."),
+ error (_("Unexpected type (%d) encountered "
+ "for unsigned integer constant."),
TYPE_CODE (type));
}
}
\"$__\" holds the contents of the last address examined with \"x\"."),
&showlist);
- add_cmd ("values", no_class, show_values,
- _("Elements of value history around item number IDX (or last ten)."),
+ add_cmd ("values", no_class, show_values, _("\
+Elements of value history around item number IDX (or last ten)."),
&showlist);
add_com ("init-if-undefined", class_vars, init_if_undefined_command, _("\