This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Register FORTRAN types with gdbarch_swap.


Note, the other languages that have their own types probably need to
have this done too.  Causes the sizes of types to be re-computed per
architecture (since the values eg. of TARGET_LONG_BIT may change).

I'll check this in in a few days if no one objects.

Michael
2003-01-30  Michael Snyder  <msnyder@redhat.com>

	* f-lang.c (build_fortran_types): New function.
	(_initialize_f_language): Use build_fortran_types rather than 
	creating the types here.  Register the types with gdbarch_swap.
	Register build_fortran_types with gdbarch_swap.

Index: f-lang.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/f-lang.c,v
retrieving revision 2.29
diff -p -r2.29 f-lang.c
*** f-lang.c	2002/05/02 00:37:37	2.29
--- f-lang.c	2003/01/30 20:34:29
*************** const struct language_defn f_language_de
*** 483,490 ****
    LANG_MAGIC
  };
  
! void
! _initialize_f_language (void)
  {
    builtin_type_f_void =
      init_type (TYPE_CODE_VOID, 1,
--- 483,490 ----
    LANG_MAGIC
  };
  
! static void
! build_fortran_types (void)
  {
    builtin_type_f_void =
      init_type (TYPE_CODE_VOID, 1,
*************** _initialize_f_language (void)
*** 556,561 ****
--- 556,597 ----
  	       0,
  	       "complex*32", (struct objfile *) NULL);
    TYPE_TARGET_TYPE (builtin_type_f_complex_s32) = builtin_type_f_real_s16;
+ }
+ 
+ void
+ _initialize_f_language (void)
+ {
+   build_fortran_types ();
+   register_gdbarch_swap (&builtin_type_f_character, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_f_logical, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_f_logical_s1, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_f_logical_s2, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_f_integer, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_f_integer_s2, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_f_real, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_f_real_s8, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_f_real_s16, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_f_complex_s8, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_f_complex_s16, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_f_complex_s32, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_f_void, 
+ 			 sizeof (struct type *), NULL);
+   register_gdbarch_swap (&builtin_type_string, 
+ 			 sizeof (struct type *), NULL);
+ 
+   register_gdbarch_swap (NULL, 0, build_fortran_types);
  
    builtin_type_string =
      init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]