aboutsummaryrefslogtreecommitdiff
path: root/gdb/m2-exp.y
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-10-24 23:42:02 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-10-24 23:42:02 +0000
commitabe28b921434c6ca63208f33a3b4a65b33f867f4 (patch)
treec4472ef325f51588ba8a936f10ea98fbcf44a7f2 /gdb/m2-exp.y
parent94c74a0c226734e91d0d3e3812abe9142b8c3244 (diff)
downloadgdb-abe28b921434c6ca63208f33a3b4a65b33f867f4.zip
gdb-abe28b921434c6ca63208f33a3b4a65b33f867f4.tar.gz
gdb-abe28b921434c6ca63208f33a3b4a65b33f867f4.tar.bz2
Sun Oct 24 20:16:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* parse.c, parser-defs.h (write_exp_msymbol): New function to write the appropriate expression for a minimal symbol. * c-exp.y, m2-exp.y: Use it.
Diffstat (limited to 'gdb/m2-exp.y')
-rw-r--r--gdb/m2-exp.y20
1 files changed, 5 insertions, 15 deletions
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index 07448b1..518f11a 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -623,23 +623,13 @@ variable: NAME
struct minimal_symbol *msymbol;
register char *arg = copy_name ($1);
- msymbol = lookup_minimal_symbol (arg,
- (struct objfile *) NULL);
+ msymbol = lookup_minimal_symbol (arg, NULL);
if (msymbol != NULL)
{
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_long);
- write_exp_elt_longcst ((LONGEST) SYMBOL_VALUE_ADDRESS (msymbol));
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_opcode (UNOP_MEMVAL);
- if (msymbol -> type == mst_data ||
- msymbol -> type == mst_bss)
- write_exp_elt_type (builtin_type_int);
- else if (msymbol -> type == mst_text)
- write_exp_elt_type (lookup_function_type (builtin_type_int));
- else
- write_exp_elt_type (builtin_type_char);
- write_exp_elt_opcode (UNOP_MEMVAL);
+ write_exp_msymbol
+ (msymbol,
+ lookup_function_type (builtin_type_int),
+ builtin_type_int);
}
else if (!have_full_symbols () && !have_partial_symbols ())
error ("No symbol table is loaded. Use the \"symbol-file\" command.");