aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1995-01-26 02:32:25 +0000
committerPer Bothner <per@bothner.com>1995-01-26 02:32:25 +0000
commitacc4efdecd034e70feffeb15799745880ce2c45b (patch)
tree6221711e6e08f7fee1cfe7cd590aeb2f65196089 /gdb/c-lang.c
parentb66051ec1950ddd647fbfa629bcec40ba8bd5d25 (diff)
downloadgdb-acc4efdecd034e70feffeb15799745880ce2c45b.zip
gdb-acc4efdecd034e70feffeb15799745880ce2c45b.tar.gz
gdb-acc4efdecd034e70feffeb15799745880ce2c45b.tar.bz2
* language.h (struct language_defn): New field c_style_arrays.
* language.c (unknown_language_defn, auto_language_defn, local_language_defn), c-lang.c (c_language_defn, cplus_language_defn, asm_language_defn): Set c_style_arrays to true. * m2-lang.c (m2_language_defn), ch-lang.c (chill_language_defn), f-lang.c (f_language_defn): Set c_style_arrays to false. * valops.c (value_string): If c_style_array is not set, allocate string in gdb (not inferior) using allocate_value. * value.h (COERCE_ARRAY), valops.c (value_addr, value_arg_coerce): Only call value_coerce_array if current_language->c_style_arrays. * values.c: Add #include "language.h". (Needed for COERCE_ARRAY.) * valops.c (chill_varying_type): New predicate. * valops.c (value_cast): Support assigning a fixed string or array to a variable string/array structure. * valarith.c (value_subscripted_rvalue): Extra parameter lowerbound. Check index>=lowerbound, and then add lowerbound to index here, instead of in caller. Generalize to arbitrary lval_types. (value_subscript): Use enhanced value_subscripted_rvalue if c_style_arrays is false (and index is in range).
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r--gdb/c-lang.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 98d09eb..eccd230 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -410,6 +410,7 @@ const struct language_defn c_language_defn = {
{"%ld", "", "d", ""}, /* Decimal format info */
{"0x%lx", "0x", "x", ""}, /* Hex format info */
c_op_print_tab, /* expression operators for printing */
+ 1, /* c-style arrays */
LANG_MAGIC
};
@@ -432,6 +433,7 @@ const struct language_defn cplus_language_defn = {
{"%ld", "", "d", ""}, /* Decimal format info */
{"0x%lx", "0x", "x", ""}, /* Hex format info */
c_op_print_tab, /* expression operators for printing */
+ 1, /* c-style arrays */
LANG_MAGIC
};
@@ -454,6 +456,7 @@ const struct language_defn asm_language_defn = {
{"%ld", "", "d", ""}, /* Decimal format info */
{"0x%lx", "0x", "x", ""}, /* Hex format info */
c_op_print_tab, /* expression operators for printing */
+ 1, /* c-style arrays */
LANG_MAGIC
};