| 1 | /* Fortran language support definitions for GDB, the GNU debugger. |
| 2 | |
| 3 | Copyright (C) 1992, 1993, 1994, 1995, 1998, 2000, 2005 Free Software |
| 4 | Foundation, Inc. |
| 5 | |
| 6 | Contributed by Motorola. Adapted from the C definitions by Farooq Butt |
| 7 | (fmbutt@engage.sps.mot.com). |
| 8 | |
| 9 | This file is part of GDB. |
| 10 | |
| 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 |
| 13 | the Free Software Foundation; either version 2 of the License, or |
| 14 | (at your option) any later version. |
| 15 | |
| 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. |
| 20 | |
| 21 | You should have received a copy of the GNU General Public License |
| 22 | along with this program; if not, write to the Free Software |
| 23 | Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 24 | Boston, MA 02110-1301, USA. */ |
| 25 | |
| 26 | extern int f_parse (void); |
| 27 | |
| 28 | extern void f_error (char *); /* Defined in f-exp.y */ |
| 29 | |
| 30 | extern void f_print_type (struct type *, char *, struct ui_file *, int, |
| 31 | int); |
| 32 | |
| 33 | extern int f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, |
| 34 | struct ui_file *, int, int, int, |
| 35 | enum val_prettyprint); |
| 36 | |
| 37 | /* Language-specific data structures */ |
| 38 | |
| 39 | /* In F90 subrange expression, either bound could be empty, indicating that |
| 40 | its value is by default that of the corresponding bound of the array or |
| 41 | string. So we have four sorts of subrange in F90. This enumeration type |
| 42 | is to identify this. */ |
| 43 | |
| 44 | enum f90_range_type |
| 45 | { |
| 46 | BOTH_BOUND_DEFAULT, /* "(:)" */ |
| 47 | LOW_BOUND_DEFAULT, /* "(:high)" */ |
| 48 | HIGH_BOUND_DEFAULT, /* "(low:)" */ |
| 49 | NONE_BOUND_DEFAULT /* "(low:high)" */ |
| 50 | }; |
| 51 | |
| 52 | struct common_entry |
| 53 | { |
| 54 | struct symbol *symbol; /* The symbol node corresponding |
| 55 | to this component */ |
| 56 | struct common_entry *next; /* The next component */ |
| 57 | }; |
| 58 | |
| 59 | struct saved_f77_common |
| 60 | { |
| 61 | char *name; /* Name of COMMON */ |
| 62 | char *owning_function; /* Name of parent function */ |
| 63 | int secnum; /* Section # of .bss */ |
| 64 | CORE_ADDR offset; /* Offset from .bss for |
| 65 | this block */ |
| 66 | struct common_entry *entries; /* List of block's components */ |
| 67 | struct common_entry *end_of_entries; /* ptr. to end of components */ |
| 68 | struct saved_f77_common *next; /* Next saved COMMON block */ |
| 69 | }; |
| 70 | |
| 71 | typedef struct saved_f77_common SAVED_F77_COMMON, *SAVED_F77_COMMON_PTR; |
| 72 | |
| 73 | typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR; |
| 74 | |
| 75 | extern SAVED_F77_COMMON_PTR head_common_list; /* Ptr to 1st saved COMMON */ |
| 76 | extern SAVED_F77_COMMON_PTR tail_common_list; /* Ptr to last saved COMMON */ |
| 77 | extern SAVED_F77_COMMON_PTR current_common; /* Ptr to current COMMON */ |
| 78 | |
| 79 | extern SAVED_F77_COMMON_PTR find_common_for_function (char *, char *); |
| 80 | |
| 81 | #define UNINITIALIZED_SECNUM -1 |
| 82 | #define COMMON_NEEDS_PATCHING(blk) ((blk)->secnum == UNINITIALIZED_SECNUM) |
| 83 | |
| 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 */ |
| 87 | |
| 88 | #define BOUND_FETCH_OK 1 |
| 89 | #define BOUND_FETCH_ERROR -999 |
| 90 | |
| 91 | /* When reasonable array bounds cannot be fetched, such as when |
| 92 | you ask to 'mt print symbols' and there is no stack frame and |
| 93 | therefore no way of knowing the bounds of stack-based arrays, |
| 94 | we have to assign default bounds, these are as good as any... */ |
| 95 | |
| 96 | #define DEFAULT_UPPER_BOUND 999999 |
| 97 | #define DEFAULT_LOWER_BOUND -999999 |
| 98 | |
| 99 | extern char *real_main_name; /* Name of main function */ |
| 100 | extern int real_main_c_value; /* C_value field of main function */ |
| 101 | |
| 102 | extern int f77_get_dynamic_upperbound (struct type *, int *); |
| 103 | |
| 104 | extern int f77_get_dynamic_lowerbound (struct type *, int *); |
| 105 | |
| 106 | extern void f77_get_dynamic_array_length (struct type *); |
| 107 | |
| 108 | extern int calc_f77_array_dims (struct type *); |
| 109 | |
| 110 | #define DEFAULT_DOTMAIN_NAME_IN_MF77 ".MAIN_" |
| 111 | #define DEFAULT_MAIN_NAME_IN_MF77 "MAIN_" |
| 112 | #define DEFAULT_DOTMAIN_NAME_IN_XLF_BUGGY ".main " |
| 113 | #define DEFAULT_DOTMAIN_NAME_IN_XLF ".main" |