summaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2007-12-04 23:33:00 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2007-12-04 23:33:00 +0000
commit90d48588784934b224bd60c8377fd64884ae828a (patch)
treea6ef2421eea39c869371cc44f88774a2f72852d5 /gdb/stabsread.c
parente1802bd2f9cdf215da1f0949bd4ad798ecee94c3 (diff)
downloadgdb-90d48588784934b224bd60c8377fd64884ae828a.tar.gz
* coffread.c (decode_type): Use builtin_type_int32 instead
of FT_INTEGER fundamental type for array range index type. (decode_base_type): Use builtin types of current_gdbarch instead of fundamental types. * dwarf2read.c (struct dwarf2_cu): Remove ftypes member. (read_file_scope): Do not initialize ftypes member. (dwarf_base_type, dwarf2_fundamental_types): Remove functions. (read_array_type): Use builtin_type_int32 instead of FT_INTEGER fundamental type for array range index type. (read_tag_string_type): Likewise for string range index type. Also, do not overwrite FT_CHAR type with new string type. (read_base_type): If DW_AT_name is missing, create unnamed type with given properties instead of looking for a fundamental type. Create new types as TYPE_TARGET_TYPE for DW_ATE_address and DW_ATE_complex_float types. (read_subrange_type): Create new type to represent missing DW_AT_type instead of looking for a fundamental type. (die_type): Use builtin type to represent "void" instead of looking for a fundamental type. * stabsread.c (define_symbol): Use builtin types to represent 'r' and 'i' floating-point and integer constants. * gdbtypes.c (lookup_fundamental_type): Remove. * gdbtypes.h (lookup_fundamental_type): Remove prototype. (FT_VOID, FT_BOOLEAN, FT_CHAR, FT_SIGNED_CHAR, FT_UNSIGNED_CHAR, FT_SHORT, FT_SIGNED_SHORT, FT_UNSIGNED_SHORT, FT_INTEGER, FT_SIGNED_INTEGER, FT_UNSIGNED_INTEGER, FT_LONG, FT_SIGNED_LONG, FT_UNSIGNED_LONG, FT_LONG_LONG, FT_SIGNED_LONG_LONG, FT_UNSIGNED_LONG_LONG, FT_FLOAT, FT_DBL_PREC_FLOAT, FT_EXT_PREC_FLOAT, FT_COMPLEX, FT_DBL_PREC_COMPLEX, FT_EXT_PREC_COMPLEX, FT_STRING, FT_FIXED_DECIMAL, FT_FLOAT_DECIMAL, FT_BYTE, FT_UNSIGNED_BYTE, FT_TEMPLATE_ARG, FT_DECFLOAT, FT_DBL_PREC_DECFLOAT, FT_EXT_PREC_DECFLOAT, FT_NUM_MEMBERS): Remove macros. * objfiles.c (struct objfile): Remove fundamental_types member. * symfile.c (reread_symbols): Do not clear fundamental_types. * language.h (struct language_defn): Remove la_fund_type member. (create_fundamental_type): Remove. * language.c (unk_lang_create_fundamental_type): Remove. (unknown_language_defn, auto_language_defn, local_language_defn): Adapt initializer. * ada-lang.c (ada_create_fundamental_type): Remove. (ada_language_defn): Adapt initializer. * c-lang.h (c_create_fundamental_type): Remove prototype. * c-lang.c (c_create_fundamental_type): Remove. (c_language_defn, cplus_language_defn, asm_language_defn, minimal_language_defn): Adapt initializer. * f-lang.c (f_create_fundamental_type): Remove. (f_language_defn): Adapt initializer. * jv-lang.c (java_create_fundamental_type): Remove. (java_language_defn): Adapt initializer. * m2-lang.c (m2_create_fundamental_type): Remove. (m2_language_defn): Adapt initializer. * objc-lang.c (objc_create_fundamental_type): Remove. (objc_language_defn): Adapt initializer. * p-lang.h (pascal_create_fundamental_type): Remove prototype. * p-lang.c (pascal_create_fundamental_type): Remove. (pascal_language_defn): Adapt initializer. * scm-lang.c (scm_language_defn): Adapt initializer.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r--gdb/stabsread.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index fb031c71116..07cfe08cea5 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -725,24 +725,19 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
{
double d = atof (p);
gdb_byte *dbl_valu;
+ struct type *dbl_type;
/* FIXME-if-picky-about-floating-accuracy: Should be using
target arithmetic to get the value. real.c in GCC
probably has the necessary code. */
- /* FIXME: lookup_fundamental_type is a hack. We should be
- creating a type especially for the type of float constants.
- Problem is, what type should it be?
-
- Also, what should the name of this type be? Should we
- be using 'S' constants (see stabs.texinfo) instead? */
-
- SYMBOL_TYPE (sym) = lookup_fundamental_type (objfile,
- FT_DBL_PREC_FLOAT);
+ dbl_type = builtin_type (current_gdbarch)->builtin_double;
dbl_valu =
obstack_alloc (&objfile->objfile_obstack,
- TYPE_LENGTH (SYMBOL_TYPE (sym)));
- store_typed_floating (dbl_valu, SYMBOL_TYPE (sym), d);
+ TYPE_LENGTH (dbl_type));
+ store_typed_floating (dbl_valu, dbl_type, d);
+
+ SYMBOL_TYPE (sym) = dbl_type;
SYMBOL_VALUE_BYTES (sym) = dbl_valu;
SYMBOL_CLASS (sym) = LOC_CONST_BYTES;
}
@@ -756,22 +751,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
types; other languages probably should have at least
unsigned as well as signed constants. */
- /* We just need one int constant type for all objfiles.
- It doesn't depend on languages or anything (arguably its
- name should be a language-specific name for a type of
- that size, but I'm inclined to say that if the compiler
- wants a nice name for the type, it can use 'e'). */
- static struct type *int_const_type;
-
- /* Yes, this is as long as a *host* int. That is because we
- use atoi. */
- if (int_const_type == NULL)
- int_const_type =
- init_type (TYPE_CODE_INT,
- sizeof (int) * HOST_CHAR_BIT / TARGET_CHAR_BIT, 0,
- "integer constant",
- (struct objfile *) NULL);
- SYMBOL_TYPE (sym) = int_const_type;
+ SYMBOL_TYPE (sym) = builtin_type (current_gdbarch)->builtin_long;
SYMBOL_VALUE (sym) = atoi (p);
SYMBOL_CLASS (sym) = LOC_CONST;
}