* parse.c (write_exp_msymbol): Use new variables
authorJim Kingdon <jkingdon@engr.sgi.com>
Tue, 17 Jan 1995 16:16:20 +0000 (16:16 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Tue, 17 Jan 1995 16:16:20 +0000 (16:16 +0000)
msym_*_symbol_type as type of msymbol expression.
(_initialize_parse): Initialize them.

gdb/ChangeLog
gdb/parse.c

index ef1a241779e4100c1d433db5791e4daf6437b80d..30951ef2e99d3bd8b7f7b435e6fc285659ca822a 100644 (file)
@@ -1,3 +1,9 @@
+Tue Jan 17 09:48:38 1995  Jim Kingdon  <kingdon@lioth.cygnus.com>
+
+       * 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  <shebs@andros.cygnus.com>
 
        General cleanup and simplication of disassembler interface.
index 8ca379e83ce2e0fe2b7c5b48b44c4f0ef8e110ce..620f35d1349d71b180aa34e9bea4257f10527197 100644 (file)
@@ -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);
 }