gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdb / f-lang.h
CommitLineData
c906108c 1/* Fortran language support definitions for GDB, the GNU debugger.
a2bd3dcd 2
b811d2c2 3 Copyright (C) 1992-2020 Free Software Foundation, Inc.
a2bd3dcd 4
c906108c
SS
5 Contributed by Motorola. Adapted from the C definitions by Farooq Butt
6 (fmbutt@engage.sps.mot.com).
7
c5aa993b 8 This file is part of GDB.
c906108c 9
c5aa993b
JM
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
a9762ec7 12 the Free Software Foundation; either version 3 of the License, or
c5aa993b 13 (at your option) any later version.
c906108c 14
c5aa993b
JM
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
c906108c 19
c5aa993b 20 You should have received a copy of the GNU General Public License
a9762ec7 21 along with this program. If not, see <http://www.gnu.org/licenses/>. */
c906108c 22
1a5c2598
TT
23#ifndef F_LANG_H
24#define F_LANG_H
25
79d43c61 26struct type_print_options;
410a0ff2 27struct parser_state;
79d43c61 28
410a0ff2 29extern int f_parse (struct parser_state *);
c906108c 30
1f20c35e
AB
31/* Implement the la_print_typedef language method for Fortran. */
32
33extern void f_print_typedef (struct type *type, struct symbol *new_symbol,
34 struct ui_file *stream);
35
25b524e8 36extern void f_print_type (struct type *, const char *, struct ui_file *, int,
79d43c61 37 int, const struct type_print_options *);
c906108c 38
24051bbe
TT
39/* Implement la_value_print_inner for Fortran. */
40
41extern void f_value_print_innner (struct value *val, struct ui_file *stream,
42 int recurse,
43 const struct value_print_options *options);
44
c5aa993b 45/* Language-specific data structures */
c906108c 46
4357ac6c 47/* A common block. */
c906108c 48
4357ac6c
TT
49struct common_block
50{
51 /* The number of entries in the block. */
52 size_t n_entries;
c906108c 53
4357ac6c
TT
54 /* The contents of the block, allocated using the struct hack. All
55 pointers in the array are non-NULL. */
56 struct symbol *contents[1];
57};
c906108c 58
2880242d 59extern LONGEST f77_get_upperbound (struct type *);
c906108c 60
2880242d 61extern LONGEST f77_get_lowerbound (struct type *);
c906108c 62
a14ed312 63extern void f77_get_dynamic_array_length (struct type *);
c906108c 64
a14ed312 65extern int calc_f77_array_dims (struct type *);
4cca3ac9
UW
66
67
68/* Fortran (F77) types */
69
70struct builtin_f_type
71{
72 struct type *builtin_character;
73 struct type *builtin_integer;
74 struct type *builtin_integer_s2;
067630bd 75 struct type *builtin_integer_s8;
4cca3ac9
UW
76 struct type *builtin_logical;
77 struct type *builtin_logical_s1;
78 struct type *builtin_logical_s2;
ce4b0682 79 struct type *builtin_logical_s8;
4cca3ac9
UW
80 struct type *builtin_real;
81 struct type *builtin_real_s8;
82 struct type *builtin_real_s16;
83 struct type *builtin_complex_s8;
84 struct type *builtin_complex_s16;
85 struct type *builtin_complex_s32;
86 struct type *builtin_void;
87};
88
89/* Return the Fortran type table for the specified architecture. */
90extern const struct builtin_f_type *builtin_f_type (struct gdbarch *gdbarch);
91
aa3cfbda
RB
92/* Ensures that function argument VALUE is in the appropriate form to
93 pass to a Fortran function. Returns a possibly new value that should
94 be used instead of VALUE.
95
96 When IS_ARTIFICIAL is true this indicates an artificial argument,
97 e.g. hidden string lengths which the GNU Fortran argument passing
98 convention specifies as being passed by value.
99
100 When IS_ARTIFICIAL is false, the argument is passed by pointer. If the
101 value is already in target memory then return a value that is a pointer
102 to VALUE. If VALUE is not in memory (e.g. an integer literal), allocate
103 space in the target, copy VALUE in, and return a pointer to the in
104 memory copy. */
105
106extern struct value *fortran_argument_convert (struct value *value,
107 bool is_artificial);
108
109/* Ensures that function argument TYPE is appropriate to inform the debugger
110 that ARG should be passed as a pointer. Returns the potentially updated
111 argument type.
112
113 If ARG is of type pointer then the type of ARG is returned, otherwise
114 TYPE is returned untouched.
115
116 This function exists to augment the types of Fortran function call
117 parameters to be pointers to the reported value, when the corresponding ARG
118 has also been wrapped in a pointer (by fortran_argument_convert). This
119 informs the debugger that these arguments should be passed as a pointer
120 rather than as the pointed to type. */
121
122extern struct type *fortran_preserve_arg_pointer (struct value *arg,
123 struct type *type);
124
1a5c2598 125#endif /* F_LANG_H */
This page took 1.447925 seconds and 4 git commands to generate.