]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/f-lang.h
* gdbtypes.h (struct main_type): Change type of name,tag_name,
[thirdparty/binutils-gdb.git] / gdb / f-lang.h
CommitLineData
c906108c 1/* Fortran language support definitions for GDB, the GNU debugger.
a2bd3dcd 2
0b302171
JB
3 Copyright (C) 1992-1995, 1998, 2000, 2005, 2007-2012 Free Software
4 Foundation, Inc.
a2bd3dcd 5
c906108c
SS
6 Contributed by Motorola. Adapted from the C definitions by Farooq Butt
7 (fmbutt@engage.sps.mot.com).
8
c5aa993b 9 This file is part of GDB.
c906108c 10
c5aa993b
JM
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
a9762ec7 13 the Free Software Foundation; either version 3 of the License, or
c5aa993b 14 (at your option) any later version.
c906108c 15
c5aa993b
JM
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
c906108c 20
c5aa993b 21 You should have received a copy of the GNU General Public License
a9762ec7 22 along with this program. If not, see <http://www.gnu.org/licenses/>. */
c906108c 23
a14ed312 24extern int f_parse (void);
c906108c 25
a14ed312 26extern void f_error (char *); /* Defined in f-exp.y */
c906108c 27
25b524e8 28extern void f_print_type (struct type *, const char *, struct ui_file *, int,
d9fcf2fb 29 int);
c906108c 30
fc1a4b47 31extern int f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
79a45b7d 32 struct ui_file *, int,
0e03807e 33 const struct value *,
79a45b7d 34 const struct value_print_options *);
c906108c 35
c5aa993b 36/* Language-specific data structures */
c906108c 37
0b4e1325
WZ
38/* In F90 subrange expression, either bound could be empty, indicating that
39 its value is by default that of the corresponding bound of the array or
40 string. So we have four sorts of subrange in F90. This enumeration type
41 is to identify this. */
42
43enum f90_range_type
44 {
45 BOTH_BOUND_DEFAULT, /* "(:)" */
46 LOW_BOUND_DEFAULT, /* "(:high)" */
47 HIGH_BOUND_DEFAULT, /* "(low:)" */
48 NONE_BOUND_DEFAULT /* "(low:high)" */
49 };
50
c906108c 51struct common_entry
c5aa993b
JM
52 {
53 struct symbol *symbol; /* The symbol node corresponding
54 to this component */
55 struct common_entry *next; /* The next component */
56 };
c906108c
SS
57
58struct saved_f77_common
c5aa993b
JM
59 {
60 char *name; /* Name of COMMON */
61 char *owning_function; /* Name of parent function */
62 int secnum; /* Section # of .bss */
63 CORE_ADDR offset; /* Offset from .bss for
64 this block */
65 struct common_entry *entries; /* List of block's components */
66 struct common_entry *end_of_entries; /* ptr. to end of components */
67 struct saved_f77_common *next; /* Next saved COMMON block */
68 };
c906108c 69
c5aa993b 70typedef struct saved_f77_common SAVED_F77_COMMON, *SAVED_F77_COMMON_PTR;
c906108c 71
c5aa993b 72typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR;
c906108c 73
c5aa993b
JM
74extern SAVED_F77_COMMON_PTR head_common_list; /* Ptr to 1st saved COMMON */
75extern SAVED_F77_COMMON_PTR tail_common_list; /* Ptr to last saved COMMON */
76extern SAVED_F77_COMMON_PTR current_common; /* Ptr to current COMMON */
c906108c 77
0d5cff50
DE
78extern SAVED_F77_COMMON_PTR find_common_for_function (const char *,
79 const char *);
c906108c 80
c5aa993b 81#define UNINITIALIZED_SECNUM -1
c906108c
SS
82#define COMMON_NEEDS_PATCHING(blk) ((blk)->secnum == UNINITIALIZED_SECNUM)
83
c5aa993b
JM
84#define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM" /* XLF assigned */
85#define BLANK_COMMON_NAME_MF77 "__BLNK__" /* MF77 assigned */
86#define BLANK_COMMON_NAME_LOCAL "__BLANK" /* Local GDB */
c906108c 87
c906108c 88/* When reasonable array bounds cannot be fetched, such as when
c5aa993b
JM
89 you ask to 'mt print symbols' and there is no stack frame and
90 therefore no way of knowing the bounds of stack-based arrays,
0963b4bd 91 we have to assign default bounds, these are as good as any... */
c906108c
SS
92
93#define DEFAULT_UPPER_BOUND 999999
94#define DEFAULT_LOWER_BOUND -999999
95
0963b4bd
MS
96extern char *real_main_name; /* Name of main function. */
97extern int real_main_c_value; /* C_value field of main function. */
c906108c 98
d78df370 99extern int f77_get_upperbound (struct type *);
c906108c 100
d78df370 101extern int f77_get_lowerbound (struct type *);
c906108c 102
a14ed312 103extern void f77_get_dynamic_array_length (struct type *);
c906108c 104
a14ed312 105extern int calc_f77_array_dims (struct type *);
4cca3ac9
UW
106
107
108/* Fortran (F77) types */
109
110struct builtin_f_type
111{
112 struct type *builtin_character;
113 struct type *builtin_integer;
114 struct type *builtin_integer_s2;
115 struct type *builtin_logical;
116 struct type *builtin_logical_s1;
117 struct type *builtin_logical_s2;
ce4b0682 118 struct type *builtin_logical_s8;
4cca3ac9
UW
119 struct type *builtin_real;
120 struct type *builtin_real_s8;
121 struct type *builtin_real_s16;
122 struct type *builtin_complex_s8;
123 struct type *builtin_complex_s16;
124 struct type *builtin_complex_s32;
125 struct type *builtin_void;
126};
127
128/* Return the Fortran type table for the specified architecture. */
129extern const struct builtin_f_type *builtin_f_type (struct gdbarch *gdbarch);
130