#include "ax-gdb.h"
#include "gdb_string.h"
#include "block.h"
+#include "regcache.h"
/* To make sense of this file, you should read doc/agentexpr.texi.
Then look at the types and enums in ax-gdb.h. For the code itself,
static void gen_expr (union exp_element **pc,
struct agent_expr *ax, struct axs_value *value);
-static void print_axs_value (struct ui_file *f, struct axs_value * value);
static void agent_command (char *exp, int from_tty);
\f
case LOC_TYPEDEF:
error ("Cannot compute value of typedef `%s'.",
- SYMBOL_SOURCE_NAME (var));
+ SYMBOL_PRINT_NAME (var));
break;
case LOC_BLOCK:
case LOC_UNRESOLVED:
{
struct minimal_symbol *msym
- = lookup_minimal_symbol (SYMBOL_NAME (var), NULL, NULL);
+ = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (var), NULL, NULL);
if (!msym)
- error ("Couldn't resolve symbol `%s'.", SYMBOL_SOURCE_NAME (var));
+ error ("Couldn't resolve symbol `%s'.", SYMBOL_PRINT_NAME (var));
/* Push the address of the variable. */
ax_const_l (ax, SYMBOL_VALUE_ADDRESS (msym));
}
break;
+ case LOC_COMPUTED:
+ case LOC_COMPUTED_ARG:
+ /* FIXME: cagney/2004-01-26: It should be possible to
+ unconditionally call the SYMBOL_OPS method when available.
+ Unfortunately DWARF 2 stores the frame-base (instead of the
+ function) location in a function's symbol. Oops! For the
+ moment enable this when/where applicable. */
+ SYMBOL_OPS (var)->tracepoint_var_ref (var, ax, value);
+ break;
+
case LOC_OPTIMIZED_OUT:
error ("The variable `%s' has been optimized out.",
- SYMBOL_SOURCE_NAME (var));
+ SYMBOL_PRINT_NAME (var));
break;
default:
error ("Cannot find value of botched symbol `%s'.",
- SYMBOL_SOURCE_NAME (var));
+ SYMBOL_PRINT_NAME (var));
break;
}
}
(*pc) += 3;
value->kind = axs_lvalue_register;
value->u.reg = reg;
- value->type = REGISTER_VIRTUAL_TYPE (reg);
+ value->type = register_type (current_gdbarch, reg);
}
break;
discard_cleanups (old_chain);
return ax;
}
-\f
-
-
-/* The "agent" command, for testing: compile and disassemble an expression. */
-
-static void
-print_axs_value (struct ui_file *f, struct axs_value *value)
-{
- switch (value->kind)
- {
- case axs_rvalue:
- fputs_filtered ("rvalue", f);
- break;
-
- case axs_lvalue_memory:
- fputs_filtered ("memory lvalue", f);
- break;
-
- case axs_lvalue_register:
- fprintf_filtered (f, "register %d lvalue", value->u.reg);
- break;
- }
-
- fputs_filtered (" : ", f);
- type_print (value->type, "", f, -1);
-}
-
static void
agent_command (char *exp, int from_tty)