xref: /dflybsd-src/contrib/gdb-7/gdb/f-lang.h (revision de8e141f24382815c10a4012d209bbbf7abf1112)
15796c8dcSSimon Schubert /* Fortran language support definitions for GDB, the GNU debugger.
25796c8dcSSimon Schubert 
3*ef5ccd6cSJohn Marino    Copyright (C) 1992-2013 Free Software Foundation, Inc.
45796c8dcSSimon Schubert 
55796c8dcSSimon Schubert    Contributed by Motorola.  Adapted from the C definitions by Farooq Butt
65796c8dcSSimon Schubert    (fmbutt@engage.sps.mot.com).
75796c8dcSSimon Schubert 
85796c8dcSSimon Schubert    This file is part of GDB.
95796c8dcSSimon Schubert 
105796c8dcSSimon Schubert    This program is free software; you can redistribute it and/or modify
115796c8dcSSimon Schubert    it under the terms of the GNU General Public License as published by
125796c8dcSSimon Schubert    the Free Software Foundation; either version 3 of the License, or
135796c8dcSSimon Schubert    (at your option) any later version.
145796c8dcSSimon Schubert 
155796c8dcSSimon Schubert    This program is distributed in the hope that it will be useful,
165796c8dcSSimon Schubert    but WITHOUT ANY WARRANTY; without even the implied warranty of
175796c8dcSSimon Schubert    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
185796c8dcSSimon Schubert    GNU General Public License for more details.
195796c8dcSSimon Schubert 
205796c8dcSSimon Schubert    You should have received a copy of the GNU General Public License
215796c8dcSSimon Schubert    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
225796c8dcSSimon Schubert 
23*ef5ccd6cSJohn Marino struct type_print_options;
24*ef5ccd6cSJohn Marino 
255796c8dcSSimon Schubert extern int f_parse (void);
265796c8dcSSimon Schubert 
275796c8dcSSimon Schubert extern void f_error (char *);	/* Defined in f-exp.y */
285796c8dcSSimon Schubert 
29cf7f2e2dSJohn Marino extern void f_print_type (struct type *, const char *, struct ui_file *, int,
30*ef5ccd6cSJohn Marino 			  int, const struct type_print_options *);
315796c8dcSSimon Schubert 
32*ef5ccd6cSJohn Marino extern void f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
335796c8dcSSimon Schubert 			 struct ui_file *, int,
34cf7f2e2dSJohn Marino 			 const struct value *,
355796c8dcSSimon Schubert 			 const struct value_print_options *);
365796c8dcSSimon Schubert 
375796c8dcSSimon Schubert /* Language-specific data structures */
385796c8dcSSimon Schubert 
395796c8dcSSimon Schubert /* In F90 subrange expression, either bound could be empty, indicating that
405796c8dcSSimon Schubert    its value is by default that of the corresponding bound of the array or
415796c8dcSSimon Schubert    string.  So we have four sorts of subrange in F90.  This enumeration type
425796c8dcSSimon Schubert    is to identify this.  */
435796c8dcSSimon Schubert 
445796c8dcSSimon Schubert enum f90_range_type
455796c8dcSSimon Schubert   {
465796c8dcSSimon Schubert     BOTH_BOUND_DEFAULT,		/* "(:)"  */
475796c8dcSSimon Schubert     LOW_BOUND_DEFAULT,		/* "(:high)"  */
485796c8dcSSimon Schubert     HIGH_BOUND_DEFAULT,		/* "(low:)"  */
495796c8dcSSimon Schubert     NONE_BOUND_DEFAULT		/* "(low:high)"  */
505796c8dcSSimon Schubert   };
515796c8dcSSimon Schubert 
52*ef5ccd6cSJohn Marino /* A common block.  */
53*ef5ccd6cSJohn Marino 
54*ef5ccd6cSJohn Marino struct common_block
555796c8dcSSimon Schubert {
56*ef5ccd6cSJohn Marino   /* The number of entries in the block.  */
57*ef5ccd6cSJohn Marino   size_t n_entries;
58*ef5ccd6cSJohn Marino 
59*ef5ccd6cSJohn Marino   /* The contents of the block, allocated using the struct hack.  All
60*ef5ccd6cSJohn Marino      pointers in the array are non-NULL.  */
61*ef5ccd6cSJohn Marino   struct symbol *contents[1];
625796c8dcSSimon Schubert };
635796c8dcSSimon Schubert 
645796c8dcSSimon Schubert extern int f77_get_upperbound (struct type *);
655796c8dcSSimon Schubert 
665796c8dcSSimon Schubert extern int f77_get_lowerbound (struct type *);
675796c8dcSSimon Schubert 
685796c8dcSSimon Schubert extern void f77_get_dynamic_array_length (struct type *);
695796c8dcSSimon Schubert 
705796c8dcSSimon Schubert extern int calc_f77_array_dims (struct type *);
715796c8dcSSimon Schubert 
725796c8dcSSimon Schubert 
735796c8dcSSimon Schubert /* Fortran (F77) types */
745796c8dcSSimon Schubert 
755796c8dcSSimon Schubert struct builtin_f_type
765796c8dcSSimon Schubert {
775796c8dcSSimon Schubert   struct type *builtin_character;
785796c8dcSSimon Schubert   struct type *builtin_integer;
795796c8dcSSimon Schubert   struct type *builtin_integer_s2;
805796c8dcSSimon Schubert   struct type *builtin_logical;
815796c8dcSSimon Schubert   struct type *builtin_logical_s1;
825796c8dcSSimon Schubert   struct type *builtin_logical_s2;
83cf7f2e2dSJohn Marino   struct type *builtin_logical_s8;
845796c8dcSSimon Schubert   struct type *builtin_real;
855796c8dcSSimon Schubert   struct type *builtin_real_s8;
865796c8dcSSimon Schubert   struct type *builtin_real_s16;
875796c8dcSSimon Schubert   struct type *builtin_complex_s8;
885796c8dcSSimon Schubert   struct type *builtin_complex_s16;
895796c8dcSSimon Schubert   struct type *builtin_complex_s32;
905796c8dcSSimon Schubert   struct type *builtin_void;
915796c8dcSSimon Schubert };
925796c8dcSSimon Schubert 
935796c8dcSSimon Schubert /* Return the Fortran type table for the specified architecture.  */
945796c8dcSSimon Schubert extern const struct builtin_f_type *builtin_f_type (struct gdbarch *gdbarch);
955796c8dcSSimon Schubert 
96