+Wed Jan 25 18:13:14 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * 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).
+
Wed Jan 25 18:23:46 1995 Stu Grossman (grossman@cygnus.com)
* gdbtk.c (gdbtk_init): Prevent segfault when gdbtk.tcl can't be
{"%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
};
{"%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
};
{"%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
};
{"D'%ld", "D'", "d", ""}, /* Decimal format info */
{"H'%lx", "H'", "x", ""}, /* Hex format info */
chill_op_print_tab, /* expression operators for printing */
+ 0, /* arrays are first-class (not c-style) */
LANG_MAGIC
};
{"%d", "", "d", ""}, /* Decimal format info */
{"0x%x", "0x", "x", ""}, /* Hex format info */
f_op_print_tab, /* expression operators for printing */
+ 0, /* arrays are first-class (not c-style) */
LANG_MAGIC
};
{"%ld", "", "d", ""}, /* Decimal format info */
{"0x%lx", "0x", "x", ""}, /* Hex format info */
unk_op_print_tab, /* expression operators for printing */
+ 1, /* c-style arrays */
LANG_MAGIC
};
{"%ld", "", "d", ""}, /* Decimal format info */
{"0x%lx", "0x", "x", ""}, /* Hex format info */
unk_op_print_tab, /* expression operators for printing */
+ 1, /* c-style arrays */
LANG_MAGIC
};
{"%ld", "", "d", ""}, /* Decimal format info */
{"0x%lx", "0x", "x", ""}, /* Hex format info */
unk_op_print_tab, /* expression operators for printing */
+ 1, /* c-style arrays */
LANG_MAGIC
};
\f
const struct op_print *la_op_print_tab;
+ /* Zero if the language has first-class arrays. True if there are no
+ array values, and array objects decay to pointers, as in C. */
+
+ char c_style_arrays;
+
/* Add fields above this point, so the magic number is always last. */
/* Magic number for compat checking */
{"%ld", "", "d", ""}, /* Decimal format info */
{"0%lXH", "0", "X", "H"}, /* Hex format info */
m2_op_print_tab, /* expression operators for printing */
+ 0, /* arrays are first-class (not c-style) */
LANG_MAGIC
};
#include "command.h"
#include "gdbcmd.h"
#include "target.h"
+#include "language.h"
#include "demangle.h"
/* Local function prototypes. */