From 3864046fe017f0d2ccff5d2357f6310eaf407017 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Mon, 19 Jun 2000 10:14:22 +0000 Subject: * defs.h: define language_pascal in language enumeration. * language.h: define _LANG_pascal macro. * language.c: add language_pascal support in all language dependant functions. --- gdb/ChangeLog | 7 +++++++ gdb/defs.h | 3 ++- gdb/language.c | 29 ++++++++++++++++++++++++++++- gdb/language.h | 3 ++- 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 55a1a49f36d..f67c9ca32a1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2000-06-16 Pierre Muller + + * defs.h: define language_pascal in language enumeration. + * language.h: define _LANG_pascal macro. + * language.c: add language_pascal support in all language dependant + functions. + Sun Jun 18 01:01:09 2000 Andrew Cagney * mips-tdep.c (mips_debug): New variable. diff --git a/gdb/defs.h b/gdb/defs.h index 093358ff859..f00f76ef20e 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -196,7 +196,8 @@ enum language language_fortran, /* Fortran */ language_m2, /* Modula-2 */ language_asm, /* Assembly language */ - language_scm /* Scheme / Guile */ + language_scm, /* Scheme / Guile */ + language_pascal /* Pascal */ }; enum precision_type diff --git a/gdb/language.c b/gdb/language.c index 60f43d3f3b4..fd81f6738c9 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -814,6 +814,7 @@ integral_type (type) return (TYPE_CODE (type) != TYPE_CODE_INT) && (TYPE_CODE (type) != TYPE_CODE_ENUM) ? 0 : 1; case language_m2: + case language_pascal: return TYPE_CODE (type) != TYPE_CODE_INT ? 0 : 1; case language_chill: error ("Missing Chill support in function integral_type."); /*FIXME */ @@ -849,6 +850,7 @@ character_type (type) { case language_chill: case language_m2: + case language_pascal: return TYPE_CODE (type) != TYPE_CODE_CHAR ? 0 : 1; case language_c: @@ -871,6 +873,7 @@ string_type (type) { case language_chill: case language_m2: + case language_pascal: return TYPE_CODE (type) != TYPE_CODE_STRING ? 0 : 1; case language_c: @@ -935,6 +938,11 @@ structured_type (type) return (TYPE_CODE (type) == TYPE_CODE_STRUCT) || (TYPE_CODE (type) == TYPE_CODE_UNION) || (TYPE_CODE (type) == TYPE_CODE_ARRAY); + case language_pascal: + return (TYPE_CODE(type) == TYPE_CODE_STRUCT) || + (TYPE_CODE(type) == TYPE_CODE_UNION) || + (TYPE_CODE(type) == TYPE_CODE_SET) || + (TYPE_CODE(type) == TYPE_CODE_ARRAY); case language_m2: return (TYPE_CODE (type) == TYPE_CODE_STRUCT) || (TYPE_CODE (type) == TYPE_CODE_SET) || @@ -966,7 +974,11 @@ lang_bool_type () } return builtin_type_f_logical_s2; case language_cplus: - sym = lookup_symbol ("bool", NULL, VAR_NAMESPACE, NULL, NULL); + case language_pascal: + if (current_language->la_language==language_cplus) + {sym = lookup_symbol ("bool", NULL, VAR_NAMESPACE, NULL, NULL);} + else + {sym = lookup_symbol ("boolean", NULL, VAR_NAMESPACE, NULL, NULL);} if (sym) { type = SYMBOL_TYPE (sym); @@ -1160,6 +1172,21 @@ binop_type_check (arg1, arg2, op) } #endif +#ifdef _LANG_pascal + case language_pascal: + switch(op) + { + case BINOP_DIV: + if (!float_type(t1) && !float_type(t2)) + type_op_error ("Arguments to %s must be floating point numbers.",op); + break; + case BINOP_INTDIV: + if (!integral_type(t1) || !integral_type(t2)) + type_op_error ("Arguments to %s must be of integral type.",op); + break; + } +#endif + #ifdef _LANG_chill case language_chill: error ("Missing Chill support in function binop_type_check."); /*FIXME */ diff --git a/gdb/language.h b/gdb/language.h index 185bc919ea0..8de751d3e0c 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -35,7 +35,8 @@ struct expression; #define _LANG_c #define _LANG_m2 #define _LANG_chill -#define _LANG_fortran +#define _LANG_fortran +#define _LANG_pascal #define MAX_FORTRAN_DIMS 7 /* Maximum number of F77 array dims */ -- cgit v1.2.1