diff options
author | Per Bothner <per@bothner.com> | 1995-12-01 08:08:41 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1995-12-01 08:08:41 +0000 |
commit | a366d882c09d3fb36aafca0d3f9cc7aa1aa46dfe (patch) | |
tree | 2802fc355e6f4068462d07cb309bb152fd5ea2f9 /gdb/language.c | |
parent | 5f3e7bfcbfcd9a744d69e5ed2a2a56af38bf2e35 (diff) | |
download | gdb-a366d882c09d3fb36aafca0d3f9cc7aa1aa46dfe.zip gdb-a366d882c09d3fb36aafca0d3f9cc7aa1aa46dfe.tar.gz gdb-a366d882c09d3fb36aafca0d3f9cc7aa1aa46dfe.tar.bz2 |
* language.c (lang_bool_type), language.h: New function.
* language.h (LA_BOOL_TYPE): New macro.
* eval.c (evaluate_subexp_standard) Use LA_BOOL_TYPE instead
of builtin_type_int where appropriate,
* valarith.c (value_subscript): Likewise.
Diffstat (limited to 'gdb/language.c')
-rw-r--r-- | gdb/language.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/language.c b/gdb/language.c index 2504f86..0ce74fe 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -773,6 +773,29 @@ structured_type(type) } #endif +struct type * +lang_bool_type () +{ + struct symbol *sym; + struct type *type; + switch(current_language->la_language) + { + case language_chill: + return builtin_type_chill_bool; + case language_cplus: + sym = lookup_symbol ("bool", NULL, VAR_NAMESPACE, NULL, NULL); + if (sym) + { + struct type *type = SYMBOL_TYPE (sym); + if (type && TYPE_CODE (type) == TYPE_CODE_BOOL) + return type; + } + /* ... else fall through ... */ + default: + return builtin_type_int; + } +} + /* This page contains functions that return info about (struct value) values used in GDB. */ |