aboutsummaryrefslogtreecommitdiff
path: root/gdb/ax-gdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ax-gdb.c')
-rw-r--r--gdb/ax-gdb.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index a72a458..3fdf81a 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -733,6 +733,23 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
break;
}
}
+
+/* Generate code for a minimal symbol variable reference to AX. The
+ variable is the symbol MINSYM, of OBJFILE. Set VALUE to describe
+ the result. */
+
+static void
+gen_msym_var_ref (agent_expr *ax, axs_value *value,
+ minimal_symbol *msymbol, objfile *objf)
+{
+ CORE_ADDR address;
+ type *t = find_minsym_type_and_address (msymbol, objf, &address);
+ value->type = t;
+ value->optimized_out = false;
+ ax_const_l (ax, address);
+ value->kind = axs_lvalue_memory;
+}
+
@@ -1964,6 +1981,11 @@ gen_expr (struct expression *exp, union exp_element **pc,
(*pc) += 4;
break;
+ case OP_VAR_MSYM_VALUE:
+ gen_msym_var_ref (ax, value, (*pc)[2].msymbol, (*pc)[1].objfile);
+ (*pc) += 4;
+ break;
+
case OP_REGISTER:
{
const char *name = &(*pc)[2].string;