aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.h
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1995-02-01 21:02:51 +0000
committerPer Bothner <per@bothner.com>1995-02-01 21:02:51 +0000
commitf91a9e05e0183d596f1f307ddeb462175ca84ce8 (patch)
tree0d4a44205089ea893799272b7a78b7f8bd3acdea /gdb/value.h
parente1affd5840505e64d51482bfc3de7ea74edc5352 (diff)
downloadgdb-f91a9e05e0183d596f1f307ddeb462175ca84ce8.zip
gdb-f91a9e05e0183d596f1f307ddeb462175ca84ce8.tar.gz
gdb-f91a9e05e0183d596f1f307ddeb462175ca84ce8.tar.bz2
* ch-exp.y (value_string_element, string_primitive_value,
start_element, left_element, right_element, slice_size, lower_element, upper_element, first_element): Removed. (value_string_slice, value_array_slice): Replaced by ... (slice): New non-terminal, with working slice support. (primitive_value_lparen, rparen): New non-terminals. (maybe_tuple_elements): New non-terminal, to allow empty tuples. (idtokentab): Added "up". * value.h (COERCE_VARYING_ARRAY): New macro. * valarith.c (value_subscript): Use it. * valops.c (value_cast): Likewise. Also, do nothing if already correct type, and allow converting from/to range to/from scalar. * valops.c, value.h (varying_to_slice, value_slice): New functions. * eval.c (OP_ARRAY): Add cast for array element. * expression.h (TERNOP_SLICE, TERNOP_SLICE_COUNT): New exp_opcodes. * valops.c (chill_varying_type): Moved function frp, here ... * gdbtypes.c (chill_varying_type), gdbtypes.h: ... to here. * parse.c (length_of_subexp, prefixify_subexp): Add support for TERNOP_SLICE, TERNOP_SLICE_COUNT. * expprint.c (print_subexp, dump_expression): Likewise. * eval.c (evaluate_subexp): Likewise. * eval.c (evaluate_subexp case MULTI_SUBSCRIPT): Don't call value_x_binop on a Chill varying string.
Diffstat (limited to 'gdb/value.h')
-rw-r--r--gdb/value.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/gdb/value.h b/gdb/value.h
index 7708a44..8979dbe 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -186,8 +186,9 @@ extern int value_fetch_lazy PARAMS ((value_ptr val));
#define COERCE_ARRAY(arg) \
{ COERCE_REF(arg); \
- if (VALUE_REPEATED (arg) \
- || TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ARRAY) \
+ if (current_language->c_style_arrays \
+ && (VALUE_REPEATED (arg) \
+ || TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ARRAY)) \
arg = value_coerce_array (arg); \
if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FUNC) \
arg = value_coerce_function (arg); \
@@ -195,6 +196,9 @@ extern int value_fetch_lazy PARAMS ((value_ptr val));
arg = value_cast (builtin_type_unsigned_int, arg); \
}
+#define COERCE_VARYING_ARRAY(arg) \
+{ if (chill_varying_type (VALUE_TYPE (arg))) arg = varying_to_slice (arg); }
+
/* If ARG is an enum, convert it to an integer. */
#define COERCE_ENUM(arg) \
@@ -504,6 +508,10 @@ extern int baseclass_offset PARAMS ((struct type *, int, value_ptr, int));
/* From valops.c */
+extern value_ptr varying_to_slice PARAMS ((value_ptr));
+
+extern value_ptr value_slice PARAMS ((value_ptr, int, int));
+
extern value_ptr call_function_by_hand PARAMS ((value_ptr, int, value_ptr *));
extern value_ptr f77_value_literal_complex PARAMS ((value_ptr, value_ptr, int));