1999-04-16 09:35:26 +08:00
|
|
|
/* Fortran language support definitions for GDB, the GNU debugger.
|
2005-01-28 Andrew Cagney <cagney@gnu.org>
* language.h (struct language_defn): Make la_val_print's buffer
parameter a const bfd_byte.
* cp-valprint.c (cp_print_value_fields, cp_print_value): Update.
* ada-lang.c (ada_aligned_value_addr)
(ada_value_primitive_packed_val, ada_which_variant_applies): Update.
* valprint.c (val_print_array_elements): Update.
* valprint.h (val_print_array_elements): Update.
* ada-lang.h (ada_val_print, ada_aligned_value_addr)
(ada_value_primitive_packed_val, ada_which_variant_applies): Update.
* ada-valprint.c (ada_val_print, struct ada_val_print_args)
(ada_val_print_1, ada_print_floating, printable_val_type)
(print_record, val_print_packed_array_elements)
(print_field_values, print_variant_part): Update.
* c-lang.h (c_val_print, cp_print_value_fields): Update.
* c-valprint.c (c_val_print): Update.
* f-lang.h (f_val_print): Update.
* f-valprint.c (f_val_print, f77_print_array_1)
(f77_print_array): Update.
* jv-lang.h (java_val_print): Update.
* jv-valprint.c (java_print_value_fields, java_val_print): Update.
* language.c (unk_lang_val_print): Update.
* m2-lang.h (m2_val_print): Update.
* m2-valprint.c (m2_val_print): Update.
* p-lang.h (pascal_val_print): Update.
(pascal_object_print_value_fields): Update.
* p-valprint.c (pascal_val_print)
(pascal_object_print_value_fields, pascal_object_print_value)
(pascal_object_print_value): Update.
* scm-lang.h (scm_val_print): Update.
* scm-valprint.c (scm_val_print): Update.
* value.h (val_print): Update.
2005-01-29 09:59:31 +08:00
|
|
|
|
2008-01-02 06:53:26 +08:00
|
|
|
Copyright (C) 1992, 1993, 1994, 1995, 1998, 2000, 2005, 2007, 2008
|
2007-01-10 01:59:20 +08:00
|
|
|
Free Software Foundation, Inc.
|
2005-01-28 Andrew Cagney <cagney@gnu.org>
* language.h (struct language_defn): Make la_val_print's buffer
parameter a const bfd_byte.
* cp-valprint.c (cp_print_value_fields, cp_print_value): Update.
* ada-lang.c (ada_aligned_value_addr)
(ada_value_primitive_packed_val, ada_which_variant_applies): Update.
* valprint.c (val_print_array_elements): Update.
* valprint.h (val_print_array_elements): Update.
* ada-lang.h (ada_val_print, ada_aligned_value_addr)
(ada_value_primitive_packed_val, ada_which_variant_applies): Update.
* ada-valprint.c (ada_val_print, struct ada_val_print_args)
(ada_val_print_1, ada_print_floating, printable_val_type)
(print_record, val_print_packed_array_elements)
(print_field_values, print_variant_part): Update.
* c-lang.h (c_val_print, cp_print_value_fields): Update.
* c-valprint.c (c_val_print): Update.
* f-lang.h (f_val_print): Update.
* f-valprint.c (f_val_print, f77_print_array_1)
(f77_print_array): Update.
* jv-lang.h (java_val_print): Update.
* jv-valprint.c (java_print_value_fields, java_val_print): Update.
* language.c (unk_lang_val_print): Update.
* m2-lang.h (m2_val_print): Update.
* m2-valprint.c (m2_val_print): Update.
* p-lang.h (pascal_val_print): Update.
(pascal_object_print_value_fields): Update.
* p-valprint.c (pascal_val_print)
(pascal_object_print_value_fields, pascal_object_print_value)
(pascal_object_print_value): Update.
* scm-lang.h (scm_val_print): Update.
* scm-valprint.c (scm_val_print): Update.
* value.h (val_print): Update.
2005-01-29 09:59:31 +08:00
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
Contributed by Motorola. Adapted from the C definitions by Farooq Butt
|
|
|
|
(fmbutt@engage.sps.mot.com).
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
This file is part of GDB.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-08-24 02:08:50 +08:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
1999-07-08 04:19:36 +08:00
|
|
|
(at your option) any later version.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-24 02:08:50 +08:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
extern int f_parse (void);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
extern void f_error (char *); /* Defined in f-exp.y */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-02-02 08:21:19 +08:00
|
|
|
extern void f_print_type (struct type *, char *, struct ui_file *, int,
|
|
|
|
int);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2005-05-09 Andrew Cagney <cagney@gnu.org>
Use gdb_byte in preference to bfd_byte.
* gdbarch.sh: Update.
* gdbarch.h, gdbarch.c: Re-generate.
* ada-lang.c, ada-lang.h, ada-valprint.c, arch-utils.c: Update.
* c-lang.c, c-lang.h, c-valprint.c, cp-valprint.c: Update.
* f-lang.c, f-lang.h, f-valprint.c, gdbcore.h, jv-lang.h: Update.
* jv-valprint.c, language.c, language.h, m2-lang.c: Update.
* m2-lang.h, m2-valprint.c, objc-lang.c, p-lang.c: Update.
* p-lang.h, p-valprint.c, regcache.c, scm-lang.c: Update.
* scm-lang.h, scm-valprint.c, target.c, target.h: Update.
* tramp-frame.c, valarith.c, valops.c, valprint.c: Update.
* valprint.h, value.c, value.h: Update.
2005-05-10 05:20:35 +08:00
|
|
|
extern int f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
|
2000-02-02 08:21:19 +08:00
|
|
|
struct ui_file *, int, int, int,
|
|
|
|
enum val_prettyprint);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
/* Language-specific data structures */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2005-09-20 14:25:34 +08:00
|
|
|
/* In F90 subrange expression, either bound could be empty, indicating that
|
|
|
|
its value is by default that of the corresponding bound of the array or
|
|
|
|
string. So we have four sorts of subrange in F90. This enumeration type
|
|
|
|
is to identify this. */
|
|
|
|
|
|
|
|
enum f90_range_type
|
|
|
|
{
|
|
|
|
BOTH_BOUND_DEFAULT, /* "(:)" */
|
|
|
|
LOW_BOUND_DEFAULT, /* "(:high)" */
|
|
|
|
HIGH_BOUND_DEFAULT, /* "(low:)" */
|
|
|
|
NONE_BOUND_DEFAULT /* "(low:high)" */
|
|
|
|
};
|
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
struct common_entry
|
1999-07-08 04:19:36 +08:00
|
|
|
{
|
|
|
|
struct symbol *symbol; /* The symbol node corresponding
|
|
|
|
to this component */
|
|
|
|
struct common_entry *next; /* The next component */
|
|
|
|
};
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
struct saved_f77_common
|
1999-07-08 04:19:36 +08:00
|
|
|
{
|
|
|
|
char *name; /* Name of COMMON */
|
|
|
|
char *owning_function; /* Name of parent function */
|
|
|
|
int secnum; /* Section # of .bss */
|
|
|
|
CORE_ADDR offset; /* Offset from .bss for
|
|
|
|
this block */
|
|
|
|
struct common_entry *entries; /* List of block's components */
|
|
|
|
struct common_entry *end_of_entries; /* ptr. to end of components */
|
|
|
|
struct saved_f77_common *next; /* Next saved COMMON block */
|
|
|
|
};
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
typedef struct saved_f77_common SAVED_F77_COMMON, *SAVED_F77_COMMON_PTR;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
extern SAVED_F77_COMMON_PTR head_common_list; /* Ptr to 1st saved COMMON */
|
|
|
|
extern SAVED_F77_COMMON_PTR tail_common_list; /* Ptr to last saved COMMON */
|
|
|
|
extern SAVED_F77_COMMON_PTR current_common; /* Ptr to current COMMON */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
extern SAVED_F77_COMMON_PTR find_common_for_function (char *, char *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
#define UNINITIALIZED_SECNUM -1
|
1999-04-16 09:35:26 +08:00
|
|
|
#define COMMON_NEEDS_PATCHING(blk) ((blk)->secnum == UNINITIALIZED_SECNUM)
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
#define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM" /* XLF assigned */
|
|
|
|
#define BLANK_COMMON_NAME_MF77 "__BLNK__" /* MF77 assigned */
|
|
|
|
#define BLANK_COMMON_NAME_LOCAL "__BLANK" /* Local GDB */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
#define BOUND_FETCH_OK 1
|
|
|
|
#define BOUND_FETCH_ERROR -999
|
|
|
|
|
|
|
|
/* When reasonable array bounds cannot be fetched, such as when
|
1999-07-08 04:19:36 +08:00
|
|
|
you ask to 'mt print symbols' and there is no stack frame and
|
|
|
|
therefore no way of knowing the bounds of stack-based arrays,
|
|
|
|
we have to assign default bounds, these are as good as any... */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
#define DEFAULT_UPPER_BOUND 999999
|
|
|
|
#define DEFAULT_LOWER_BOUND -999999
|
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
extern char *real_main_name; /* Name of main function */
|
|
|
|
extern int real_main_c_value; /* C_value field of main function */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
extern int f77_get_dynamic_upperbound (struct type *, int *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
extern int f77_get_dynamic_lowerbound (struct type *, int *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
extern void f77_get_dynamic_array_length (struct type *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
extern int calc_f77_array_dims (struct type *);
|
* gdbtypes.h (builtin_type_void_data_ptr, builtin_type_void_func_ptr,
builtin_type_CORE_ADDR, builtin_type_char, builtin_type_short,
builtin_type_int, builtin_type_long, builtin_type_signed_char,
builtin_type_unsigned_char, builtin_type_unsigned_short,
builtin_type_unsigned_int, builtin_type_unsigned_long,
builtin_type_float, builtin_type_double, builtin_type_long_double,
builtin_type_complex, builtin_type_double_complex, builtin_type_string,
builtin_type_bool, builtin_type_long_long,
builtin_type_unsigned_long_long): Remove macros.
(builtin_type_f_character, builtin_type_f_integer,
builtin_type_f_integer_s2, builtin_type_f_logical,
builtin_type_f_logical_s1, builtin_type_f_logical_s2,
builtin_type_f_real, builtin_type_f_real_s8, builtin_type_f_real_s16,
builtin_type_f_complex_s8, builtin_type_f_complex_s16,
builtin_type_f_complex_s32): Likewise.
(builtin_type_m2_char, builtin_type_m2_int, builtin_type_m2_card,
builtin_type_m2_real, builtin_type_m2_bool): Likewise.
(struct builtin_f_type, builtin_f_type): Move to f-lang.h.
(struct builtin_m2_type, builtin_m2_type): Move to m2-lang.h.
* f-lang.h (struct builtin_f_type, builtin_f_type): Move here.
* m2-lang.h (struct builtin_m2_type, builtin_m2_type): Move here.
2008-09-11 22:31:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* Fortran (F77) types */
|
|
|
|
|
|
|
|
struct builtin_f_type
|
|
|
|
{
|
|
|
|
struct type *builtin_character;
|
|
|
|
struct type *builtin_integer;
|
|
|
|
struct type *builtin_integer_s2;
|
|
|
|
struct type *builtin_logical;
|
|
|
|
struct type *builtin_logical_s1;
|
|
|
|
struct type *builtin_logical_s2;
|
|
|
|
struct type *builtin_real;
|
|
|
|
struct type *builtin_real_s8;
|
|
|
|
struct type *builtin_real_s16;
|
|
|
|
struct type *builtin_complex_s8;
|
|
|
|
struct type *builtin_complex_s16;
|
|
|
|
struct type *builtin_complex_s32;
|
|
|
|
struct type *builtin_void;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Return the Fortran type table for the specified architecture. */
|
|
|
|
extern const struct builtin_f_type *builtin_f_type (struct gdbarch *gdbarch);
|
|
|
|
|