1e93f7393Sniklas /* Fortran language support definitions for GDB, the GNU debugger. 2*b725ae77Skettenis Copyright 1992, 1993, 1994, 1995, 1998, 2000 3*b725ae77Skettenis Free Software Foundation, Inc. 4e93f7393Sniklas Contributed by Motorola. Adapted from the C definitions by Farooq Butt 5e93f7393Sniklas (fmbutt@engage.sps.mot.com). 6e93f7393Sniklas 7e93f7393Sniklas This file is part of GDB. 8e93f7393Sniklas 9e93f7393Sniklas This program is free software; you can redistribute it and/or modify 10e93f7393Sniklas it under the terms of the GNU General Public License as published by 11e93f7393Sniklas the Free Software Foundation; either version 2 of the License, or 12e93f7393Sniklas (at your option) any later version. 13e93f7393Sniklas 14e93f7393Sniklas This program is distributed in the hope that it will be useful, 15e93f7393Sniklas but WITHOUT ANY WARRANTY; without even the implied warranty of 16e93f7393Sniklas MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17e93f7393Sniklas GNU General Public License for more details. 18e93f7393Sniklas 19e93f7393Sniklas You should have received a copy of the GNU General Public License 20e93f7393Sniklas along with this program; if not, write to the Free Software 21*b725ae77Skettenis Foundation, Inc., 59 Temple Place - Suite 330, 22*b725ae77Skettenis Boston, MA 02111-1307, USA. */ 23e93f7393Sniklas 24*b725ae77Skettenis extern int f_parse (void); 25e93f7393Sniklas 26*b725ae77Skettenis extern void f_error (char *); /* Defined in f-exp.y */ 27e93f7393Sniklas 28*b725ae77Skettenis extern void f_print_type (struct type *, char *, struct ui_file *, int, 29*b725ae77Skettenis int); 30e93f7393Sniklas 31*b725ae77Skettenis extern int f_val_print (struct type *, char *, int, CORE_ADDR, 32*b725ae77Skettenis struct ui_file *, int, int, int, 33*b725ae77Skettenis enum val_prettyprint); 34e93f7393Sniklas 35e93f7393Sniklas /* Language-specific data structures */ 36e93f7393Sniklas 37e93f7393Sniklas struct common_entry 38e93f7393Sniklas { 39e93f7393Sniklas struct symbol *symbol; /* The symbol node corresponding 40e93f7393Sniklas to this component */ 41e93f7393Sniklas struct common_entry *next; /* The next component */ 42e93f7393Sniklas }; 43e93f7393Sniklas 44e93f7393Sniklas struct saved_f77_common 45e93f7393Sniklas { 46e93f7393Sniklas char *name; /* Name of COMMON */ 47e93f7393Sniklas char *owning_function; /* Name of parent function */ 48e93f7393Sniklas int secnum; /* Section # of .bss */ 49e93f7393Sniklas CORE_ADDR offset; /* Offset from .bss for 50e93f7393Sniklas this block */ 51e93f7393Sniklas struct common_entry *entries; /* List of block's components */ 52e93f7393Sniklas struct common_entry *end_of_entries; /* ptr. to end of components */ 53e93f7393Sniklas struct saved_f77_common *next; /* Next saved COMMON block */ 54e93f7393Sniklas }; 55e93f7393Sniklas 56e93f7393Sniklas typedef struct saved_f77_common SAVED_F77_COMMON, *SAVED_F77_COMMON_PTR; 57e93f7393Sniklas 58e93f7393Sniklas typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR; 59e93f7393Sniklas 60e93f7393Sniklas extern SAVED_F77_COMMON_PTR head_common_list; /* Ptr to 1st saved COMMON */ 61e93f7393Sniklas extern SAVED_F77_COMMON_PTR tail_common_list; /* Ptr to last saved COMMON */ 62e93f7393Sniklas extern SAVED_F77_COMMON_PTR current_common; /* Ptr to current COMMON */ 63e93f7393Sniklas 64*b725ae77Skettenis extern SAVED_F77_COMMON_PTR find_common_for_function (char *, char *); 65e93f7393Sniklas 66e93f7393Sniklas #define UNINITIALIZED_SECNUM -1 67e93f7393Sniklas #define COMMON_NEEDS_PATCHING(blk) ((blk)->secnum == UNINITIALIZED_SECNUM) 68e93f7393Sniklas 69e93f7393Sniklas #define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM" /* XLF assigned */ 70e93f7393Sniklas #define BLANK_COMMON_NAME_MF77 "__BLNK__" /* MF77 assigned */ 71e93f7393Sniklas #define BLANK_COMMON_NAME_LOCAL "__BLANK" /* Local GDB */ 72e93f7393Sniklas 73e93f7393Sniklas #define BOUND_FETCH_OK 1 74e93f7393Sniklas #define BOUND_FETCH_ERROR -999 75e93f7393Sniklas 76e93f7393Sniklas /* When reasonable array bounds cannot be fetched, such as when 77e93f7393Sniklas you ask to 'mt print symbols' and there is no stack frame and 78e93f7393Sniklas therefore no way of knowing the bounds of stack-based arrays, 79e93f7393Sniklas we have to assign default bounds, these are as good as any... */ 80e93f7393Sniklas 81e93f7393Sniklas #define DEFAULT_UPPER_BOUND 999999 82e93f7393Sniklas #define DEFAULT_LOWER_BOUND -999999 83e93f7393Sniklas 84e93f7393Sniklas extern char *real_main_name; /* Name of main function */ 85e93f7393Sniklas extern int real_main_c_value; /* C_value field of main function */ 86e93f7393Sniklas 87*b725ae77Skettenis extern int f77_get_dynamic_upperbound (struct type *, int *); 88e93f7393Sniklas 89*b725ae77Skettenis extern int f77_get_dynamic_lowerbound (struct type *, int *); 90e93f7393Sniklas 91*b725ae77Skettenis extern void f77_get_dynamic_array_length (struct type *); 92e93f7393Sniklas 93*b725ae77Skettenis extern int calc_f77_array_dims (struct type *); 94e93f7393Sniklas 95e93f7393Sniklas #define DEFAULT_DOTMAIN_NAME_IN_MF77 ".MAIN_" 96e93f7393Sniklas #define DEFAULT_MAIN_NAME_IN_MF77 "MAIN_" 97e93f7393Sniklas #define DEFAULT_DOTMAIN_NAME_IN_XLF_BUGGY ".main " 98e93f7393Sniklas #define DEFAULT_DOTMAIN_NAME_IN_XLF ".main" 99