aboutsummaryrefslogtreecommitdiff
path: root/gdb/m2-exp.y
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1992-04-15 05:42:00 +0000
committerFred Fish <fnf@specifix.com>1992-04-15 05:42:00 +0000
commit4a11eef2ebf99f527ee5452386a5f2a099ed6b8b (patch)
tree8a8e090f544dde28aaa060b49ac7c6eee14109b3 /gdb/m2-exp.y
parente4b9dd935bd566dc1f46ee4c1a6f3c31755318d5 (diff)
downloadgdb-4a11eef2ebf99f527ee5452386a5f2a099ed6b8b.zip
gdb-4a11eef2ebf99f527ee5452386a5f2a099ed6b8b.tar.gz
gdb-4a11eef2ebf99f527ee5452386a5f2a099ed6b8b.tar.bz2
Add TYPE_FLAG_FUND_TYPE bit to the flags member of the type structure,
and use it to decide when to print the actual type name rather than trying to invent the name of a fundamental type. This clears up the confusion between int/long when they are the same sizes, removes one obstacle to multi-language support (previously valprint.c thought everything was a C type), and allows gdb to support distinctions between explicitly and implicitly signed types when the compiler supports such distinction in the debug output (as does every ANSI compiler I tested except for gcc).
Diffstat (limited to 'gdb/m2-exp.y')
-rw-r--r--gdb/m2-exp.y18
1 files changed, 10 insertions, 8 deletions
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index a1bf96f..2274b16 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -1233,24 +1233,26 @@ const struct language_defn m2_language_defn = {
void
_initialize_m2_exp ()
{
- /* FIXME: The code below assumes that the sizes of the basic data
- types are the same on the host and target machines!!! */
-
/* Modula-2 "pervasive" types. NOTE: these can be redefined!!! */
builtin_type_m2_int =
- init_type (TYPE_CODE_INT, sizeof(int), 0,
+ init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE,
"INTEGER", (struct objfile *) NULL);
builtin_type_m2_card =
- init_type (TYPE_CODE_INT, sizeof(int), TYPE_FLAG_UNSIGNED,
+ init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"CARDINAL", (struct objfile *) NULL);
builtin_type_m2_real =
- init_type (TYPE_CODE_FLT, sizeof(float), 0,
+ init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE,
"REAL", (struct objfile *) NULL);
builtin_type_m2_char =
- init_type (TYPE_CODE_CHAR, sizeof(char), TYPE_FLAG_UNSIGNED,
+ init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"CHAR", (struct objfile *) NULL);
builtin_type_m2_bool =
- init_type (TYPE_CODE_BOOL, sizeof(int), TYPE_FLAG_UNSIGNED,
+ init_type (TYPE_CODE_BOOL, TARGET_INT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_FUND_TYPE | TYPE_FLAG_UNSIGNED,
"BOOLEAN", (struct objfile *) NULL);
TYPE_NFIELDS(builtin_type_m2_bool) = 2;