diff options
-rw-r--r-- | gdb/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/c-lang.c | 55 | ||||
-rw-r--r-- | gdb/gdbtypes.c | 2 | ||||
-rw-r--r-- | gdb/gdbtypes.h | 2 |
4 files changed, 64 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0247736ac..f5d626d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,15 @@ 2004-07-28 Andrew Cagney <cagney@gnu.org> + * gdbtypes.h (struct builtin_type): Rename true_char to + builtin_true_char. + * gdbtypes.c (gdbtypes_post_init): Update. + * c-lang.c (arch_info): New function. + (enum c_primitive_types): New enum. + (c_language_defn): Instead of string_char_type and + primitive_type_vector set la_language_arch_info. + +2004-07-28 Andrew Cagney <cagney@gnu.org> + * language.h (struct language_arch_info): Fix typo s/primative/primitive/. * gdbtypes.c (lookup_primitive_typename): Ditto. diff --git a/gdb/c-lang.c b/gdb/c-lang.c index a9b3ab0..0ced3ba 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -535,11 +535,60 @@ struct type **const (c_builtin_types[]) = 0 }; +enum c_primitive_types { + c_primitive_type_int, + c_primitive_type_long, + c_primitive_type_short, + c_primitive_type_char, + c_primitive_type_float, + c_primitive_type_double, + c_primitive_type_void, + c_primitive_type_long_long, + c_primitive_type_signed_char, + c_primitive_type_unsigned_char, + c_primitive_type_unsigned_short, + c_primitive_type_unsigned_int, + c_primitive_type_unsigned_long, + c_primitive_type_unsigned_long_long, + c_primitive_type_long_double, + c_primitive_type_complex, + c_primitive_type_double_complex, + nr_c_primitive_types +}; + +static void +c_language_arch_info (struct gdbarch *gdbarch, + struct language_arch_info *lai) +{ + const struct builtin_type *builtin = builtin_type (gdbarch); + lai->string_char_type = builtin->builtin_true_char; + lai->primitive_type_vector + = GDBARCH_OBSTACK_CALLOC (gdbarch, nr_c_primitive_types + 1, + struct type *); + lai->primitive_type_vector [c_primitive_type_int] = builtin->builtin_int; + lai->primitive_type_vector [c_primitive_type_long] = builtin->builtin_long; + lai->primitive_type_vector [c_primitive_type_short] = builtin->builtin_short; + lai->primitive_type_vector [c_primitive_type_char] = builtin->builtin_char; + lai->primitive_type_vector [c_primitive_type_float] = builtin->builtin_float; + lai->primitive_type_vector [c_primitive_type_double] = builtin->builtin_double; + lai->primitive_type_vector [c_primitive_type_void] = builtin->builtin_void; + lai->primitive_type_vector [c_primitive_type_long_long] = builtin->builtin_long_long; + lai->primitive_type_vector [c_primitive_type_signed_char] = builtin->builtin_signed_char; + lai->primitive_type_vector [c_primitive_type_unsigned_char] = builtin->builtin_unsigned_char; + lai->primitive_type_vector [c_primitive_type_unsigned_short] = builtin->builtin_unsigned_short; + lai->primitive_type_vector [c_primitive_type_unsigned_int] = builtin->builtin_unsigned_int; + lai->primitive_type_vector [c_primitive_type_unsigned_long] = builtin->builtin_unsigned_long; + lai->primitive_type_vector [c_primitive_type_unsigned_long_long] = builtin->builtin_unsigned_long_long; + lai->primitive_type_vector [c_primitive_type_long_double] = builtin->builtin_long_double; + lai->primitive_type_vector [c_primitive_type_complex] = builtin->builtin_complex; + lai->primitive_type_vector [c_primitive_type_double_complex] = builtin->builtin_double_complex; +}; + const struct language_defn c_language_defn = { "c", /* Language name */ language_c, - c_builtin_types, + NULL, range_check_off, type_check_off, case_sensitive_on, @@ -567,9 +616,9 @@ const struct language_defn c_language_defn = c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - &builtin_type_char, /* Type of string elements */ + NULL, default_word_break_characters, - NULL, /* FIXME: la_language_arch_info. */ + c_language_arch_info, LANG_MAGIC }; diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index c6d4812..0436719 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -3380,7 +3380,7 @@ gdbtypes_post_init (struct gdbarch *gdbarch) (TYPE_FLAG_NOSIGN | (TARGET_CHAR_SIGNED ? 0 : TYPE_FLAG_UNSIGNED)), "char", (struct objfile *) NULL); - builtin_type->true_char = + builtin_type->builtin_true_char = init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, "true character", (struct objfile *) NULL); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 3d8fbca..6a72407 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -968,7 +968,7 @@ struct builtin_type /* We use this for the '/c' print format, because c_char is just a one-byte integral type, which languages less laid back than C will print as ... well, a one-byte integral type. */ - struct type *true_char; + struct type *builtin_true_char; /* Implicit size/sign (based on the the architecture's ABI). */ struct type *builtin_void; |