aboutsummaryrefslogtreecommitdiff
path: root/gdb/parse.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1995-01-17 16:16:20 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1995-01-17 16:16:20 +0000
commit3fb93d868b03604d3cb5ef6433f2eabf98abcd11 (patch)
tree833a10fbd9d76445b2afc2f95f6e7c8d713a80e6 /gdb/parse.c
parent23f61eaae8fd0675f17c2cdaec153676afdbc124 (diff)
downloadgdb-3fb93d868b03604d3cb5ef6433f2eabf98abcd11.zip
gdb-3fb93d868b03604d3cb5ef6433f2eabf98abcd11.tar.gz
gdb-3fb93d868b03604d3cb5ef6433f2eabf98abcd11.tar.bz2
* parse.c (write_exp_msymbol): Use new variables
msym_*_symbol_type as type of msymbol expression. (_initialize_parse): Initialize them.
Diffstat (limited to 'gdb/parse.c')
-rw-r--r--gdb/parse.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/gdb/parse.c b/gdb/parse.c
index 8ca379e..620f35d 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -355,7 +355,15 @@ write_exp_bitstring (str)
}
/* Add the appropriate elements for a minimal symbol to the end of
- the expression. */
+ the expression. The rationale behind passing in text_symbol_type and
+ data_symbol_type was so that Modula-2 could pass in WORD for
+ data_symbol_type. Perhaps it still is useful to have those types vary
+ based on the language, but they no longer have names like "int", so
+ the initial rationale is gone. */
+
+static struct type *msym_text_symbol_type;
+static struct type *msym_data_symbol_type;
+static struct type *msym_unknown_symbol_type;
void
write_exp_msymbol (msymbol, text_symbol_type, data_symbol_type)
@@ -374,18 +382,18 @@ write_exp_msymbol (msymbol, text_symbol_type, data_symbol_type)
case mst_text:
case mst_file_text:
case mst_solib_trampoline:
- write_exp_elt_type (text_symbol_type);
+ write_exp_elt_type (msym_text_symbol_type);
break;
case mst_data:
case mst_file_data:
case mst_bss:
case mst_file_bss:
- write_exp_elt_type (data_symbol_type);
+ write_exp_elt_type (msym_data_symbol_type);
break;
default:
- write_exp_elt_type (builtin_type_char);
+ write_exp_elt_type (msym_unknown_symbol_type);
break;
}
write_exp_elt_opcode (UNOP_MEMVAL);
@@ -902,4 +910,14 @@ _initialize_parse ()
type_stack_depth = 0;
type_stack = (union type_stack_elt *)
xmalloc (type_stack_size * sizeof (*type_stack));
+
+ msym_text_symbol_type =
+ init_type (TYPE_CODE_FUNC, 1, 0, "<text variable without -g>", NULL);
+ TYPE_TARGET_TYPE (msym_text_symbol_type) = builtin_type_int;
+ msym_data_symbol_type =
+ init_type (TYPE_CODE_INT, TARGET_INT_BIT / HOST_CHAR_BIT, 0,
+ "<data variable without -g>", NULL);
+ msym_unknown_symbol_type =
+ init_type (TYPE_CODE_INT, 1, 0, "<unknown segment variable without -g>",
+ NULL);
}