diff options
author | Per Bothner <per@bothner.com> | 1991-11-06 01:08:21 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1991-11-06 01:08:21 +0000 |
commit | 545af6ce070ded76ef1b8697495a18dbe0990e6c (patch) | |
tree | 6ee06fb285b476377d97fa7a7e8becdaf012e44f /gdb/language.c | |
parent | 4906534f1f4f6c1a3444f370cfd9ecdf986e66a0 (diff) | |
download | gdb-545af6ce070ded76ef1b8697495a18dbe0990e6c.zip gdb-545af6ce070ded76ef1b8697495a18dbe0990e6c.tar.gz gdb-545af6ce070ded76ef1b8697495a18dbe0990e6c.tar.bz2 |
Add C++ as a separate language.
Also, fix a C++ problem when looking for methods in super-classes.
(There was confusion between base and derived types.)
Diffstat (limited to 'gdb/language.c')
-rw-r--r-- | gdb/language.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/language.c b/gdb/language.c index a7a1285..31c532c 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -122,6 +122,7 @@ set_language_command (ignore, from_tty) printf("The currently understood settings are:\n\n\ local or auto Automatic setting based on source file\n\ c Use the C language\n\ +c++ Use the C++ language\n\ modula-2 Use the Modula-2 language\n"); /* Restore the silly string. */ set_language(current_language->la_language); @@ -280,6 +281,7 @@ set_language(lang) current_language = languages[i]; set_type_range (); set_lang_str(); + break; } } } @@ -379,6 +381,7 @@ binop_result_type(v1,v2) switch(current_language->la_language) { case language_c: + case language_cplus: if (TYPE_CODE(VALUE_TYPE(v1))==TYPE_CODE_FLT) return TYPE_CODE(VALUE_TYPE(v2)) == TYPE_CODE_FLT && l2 > l1 ? VALUE_TYPE(v2) : VALUE_TYPE(v1); @@ -537,6 +540,7 @@ integral_type (type) switch(current_language->la_language) { case language_c: + case language_cplus: return (TYPE_CODE(type) != TYPE_CODE_INT) && (TYPE_CODE(type) != TYPE_CODE_ENUM) ? 0 : 1; case language_m2: @@ -572,6 +576,7 @@ character_type (type) return TYPE_CODE(type) != TYPE_CODE_CHAR ? 0 : 1; case language_c: + case language_cplus: return (TYPE_CODE(type) == TYPE_CODE_INT) && TYPE_LENGTH(type) == sizeof(char) ? 1 : 0; @@ -589,6 +594,7 @@ boolean_type (type) return TYPE_CODE(type) != TYPE_CODE_BOOL ? 0 : 1; case language_c: + case language_cplus: return TYPE_CODE(type) != TYPE_CODE_INT ? 0 : 1; } } @@ -618,6 +624,7 @@ structured_type(type) switch(current_language->la_language) { case language_c: + case language_cplus: return (TYPE_CODE(type) == TYPE_CODE_STRUCT) || (TYPE_CODE(type) == TYPE_CODE_UNION) || (TYPE_CODE(type) == TYPE_CODE_ARRAY); @@ -643,6 +650,7 @@ value_true(val) switch (current_language->la_language) { case language_c: + case language_cplus: return !value_zerop (val); case language_m2: @@ -798,6 +806,7 @@ binop_type_check(arg1,arg2,op) { #ifdef _LANG_c case language_c: + case language_cplus: switch(op) { case BINOP_DIV: |