From 3fb93d868b03604d3cb5ef6433f2eabf98abcd11 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Tue, 17 Jan 1995 16:16:20 +0000 Subject: [PATCH] * parse.c (write_exp_msymbol): Use new variables msym_*_symbol_type as type of msymbol expression. (_initialize_parse): Initialize them. --- gdb/ChangeLog | 6 ++++++ gdb/parse.c | 26 ++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ef1a241779e..30951ef2e99 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Tue Jan 17 09:48:38 1995 Jim Kingdon + + * parse.c (write_exp_msymbol): Use new variables + msym_*_symbol_type as type of msymbol expression. + (_initialize_parse): Initialize them. + Mon Jan 16 18:11:03 1995 Stan Shebs General cleanup and simplication of disassembler interface. diff --git a/gdb/parse.c b/gdb/parse.c index 8ca379e83ce..620f35d1349 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, "", 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, + "", NULL); + msym_unknown_symbol_type = + init_type (TYPE_CODE_INT, 1, 0, "", + NULL); } -- 2.30.2