aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.h
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1994-08-19 21:59:05 +0000
committerStan Shebs <shebs@codesourcery.com>1994-08-19 21:59:05 +0000
commita91a61923d82c39ebeb9971635b76c7da494cab4 (patch)
tree5d26199b5455ca2369b432d008da29521e861908 /gdb/value.h
parentf3806e3b6ceead276a3acba85ff944fde6668e39 (diff)
downloadgdb-a91a61923d82c39ebeb9971635b76c7da494cab4.zip
gdb-a91a61923d82c39ebeb9971635b76c7da494cab4.tar.gz
gdb-a91a61923d82c39ebeb9971635b76c7da494cab4.tar.bz2
Initial Fortran language support, adapted from work by Farooq Butt
(fmbutt@engage.sps.mot.com). * Makefile.in: Add Fortran-related files and dependencies. * defs.h (language_fortran): New language enum. * language.h (_LANG_fortran): Define. (MAX_FORTRAN_DIMS): Define. * expression.h: Reformat to standard. (MULTI_F77_SUBSCRIPT, OP_F77_UNDETERMINED_ARGLIST, OP_F77_LITERAL_COMPLEX, OP_F77_SUBSTR): New expression opcodes. * gdbtypes.h (TYPE_CODE_COMPLEX, TYPE_CODE_LITERAL_COMPLEX, TYPE_CODE_LITERAL_STRING): New type codes. (type): New fields upper_bound_type and lower_bound_type. (TYPE_ARRAY_UPPER_BOUND_TYPE, TYPE_ARRAY_LOWER_BOUND_TYPE, TYPE_ARRAY_UPPER_BOUND_VALUE, TYPE_ARRAY_LOWER_BOUND_VALUE): New macros. (builtin_type_f_character, etc): Declare. * value.h (VALUE_LITERAL_DATA, VALUE_SUBSTRING_START): Define. * f-exp.y: New file, Fortran expression grammar. * f-lang.c: New file, Fortran language support functions. * f-lang.h: New file, Fortran language support declarations. * f-typeprint.c: New file, Fortran type printing. * f-valprint.c: New file, Fortran value printing. * eval.c (evaluate_subexp): Add code for new expression opcodes, fix wording of error message. * gdbtypes.c (f77_create_literal_complex_type, f77_create_literal_string_type): New functions. * language.c (set_language_command): Add Fortran info. (calc_f77_array_dims): New function. * parse.c (length_of_subexp, prefixify_subexp): Add cases for new expression opcodes. * symfile.c (deduce_language_from_filename): Recognize .f and .F as Fortran source files. * valops.c (f77_value_literal_string, f77_value_substring, f77_value_literal_complex): New functions.
Diffstat (limited to 'gdb/value.h')
-rw-r--r--gdb/value.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/gdb/value.h b/gdb/value.h
index 6982258..3c4a047 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -139,6 +139,28 @@ extern int value_fetch_lazy PARAMS ((value_ptr val));
#define VALUE_REGNO(val) (val)->regno
#define VALUE_OPTIMIZED_OUT(val) ((val)->optimized_out)
+/* This is probably not the right thing to do for in-gdb arrays. FIXME */
+/* Overload the contents field to store literal data for
+ arrays. */
+
+#define VALUE_LITERAL_DATA(val) ((val)->aligner.contents[0])
+
+/* Overload the frame address field to contain a pointer to
+ the base substring, for F77 string substring operators.
+ We use this ONLY when doing operations of the form
+
+ FOO= 'hello'
+ FOO(2:4) = 'foo'
+
+ In the above case VALUE_SUBSTRING_START would point to
+ FOO(2) in the original FOO string.
+
+ Depending on whether the base object is allocated in the
+ inferior or the superior process, VALUE_SUBSTRING_START
+ contains a ptr. to memory in the relevant area. */
+
+#define VALUE_SUBSTRING_START(val) VALUE_FRAME(val)
+
/* Convert a REF to the object referenced. */
#define COERCE_REF(arg) \
@@ -433,6 +455,10 @@ print_floating PARAMS ((char *valaddr, struct type *type, GDB_FILE *stream));
extern int value_print PARAMS ((value_ptr val, GDB_FILE *stream, int format,
enum val_prettyprint pretty));
+extern void
+value_print_array_elements PARAMS ((value_ptr val, GDB_FILE* stream,
+ int format, enum val_prettyprint pretty));
+
extern value_ptr
value_release_to_mark PARAMS ((value_ptr mark));
@@ -475,4 +501,10 @@ extern int baseclass_offset PARAMS ((struct type *, int, value_ptr, 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));
+
+extern value_ptr f77_value_literal_string PARAMS ((int, int, value_ptr *));
+
+extern value_ptr f77_value_substring PARAMS ((value_ptr, int, int));
+
#endif /* !defined (VALUE_H) */