]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* mdebugread.c (new_psymtab): Pass in section_offsets and set
authorPeter Schauer <Peter.Schauer@mytum.de>
Sat, 19 Feb 1994 11:24:36 +0000 (11:24 +0000)
committerPeter Schauer <Peter.Schauer@mytum.de>
Sat, 19 Feb 1994 11:24:36 +0000 (11:24 +0000)
them in the pst.
* mdebugread.c (handle_psymbol_enumerators):  New function to enter
the enumerators of an ecoff enum into the partial symbol table.
* mdebugread.c (parse_partial_symbols):  Call it.
* symfile.c (reread_symbols):  Initialize objfile->*_psymbols.next.
* symmisc.c (dump_psymtab):  Fix typo, clean up output of section
offsets. Cast psymtab->read_symtab to PTR before passing it to
gdb_print_address.
* i386-tdep.c (i386_skip_prologue):  Skip over instructions that
set up the global offset table pointer in pic compiled code.
* config/mips/tm-mips.h (FIX_CALL_DUMMY):  For big endian targets,
error() on TYPE_CODE_FLT arguments whose size is greater than 8,
swap all other TYPE_CODE_FLT arguments as mips_push_arguments
ensures that floats are promoted to doubles before they are pushed
on the stack.

gdb/ChangeLog
gdb/mdebugread.c

index 61ca75aeb56007c5e34f44026feb35f0f6846231..c787b28deaab535f4812ca8c9fa28e8e7063e212 100644 (file)
@@ -1,3 +1,22 @@
+Sat Feb 19 03:17:32 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
+
+       * mdebugread.c (new_psymtab):  Pass in section_offsets and set
+       them in the pst.
+       * mdebugread.c (handle_psymbol_enumerators):  New function to enter
+       the enumerators of an ecoff enum into the partial symbol table.
+       * mdebugread.c (parse_partial_symbols):  Call it.
+       * symfile.c (reread_symbols):  Initialize objfile->*_psymbols.next.
+       * symmisc.c (dump_psymtab):  Fix typo, clean up output of section
+       offsets. Cast psymtab->read_symtab to PTR before passing it to
+       gdb_print_address.
+       * i386-tdep.c (i386_skip_prologue):  Skip over instructions that
+       set up the global offset table pointer in pic compiled code.
+       * config/mips/tm-mips.h (FIX_CALL_DUMMY):  For big endian targets,
+       error() on TYPE_CODE_FLT arguments whose size is greater than 8,
+       swap all other TYPE_CODE_FLT arguments as mips_push_arguments
+       ensures that floats are promoted to doubles before they are pushed
+       on the stack.
+
 Fri Feb 18 23:12:59 1994  Stu Grossman  (grossman at cygnus.com)
 
        * sparclite/Makefile.in, sparclite/salib.c, sparclite/sparclite.h:
index ad5d370be3514819d8b35811d32542f0f832bb85..2b18da5772ee0f72bc1dc2df12e3a649c6cb276e 100644 (file)
@@ -337,7 +337,7 @@ static int
 compare_blocks PARAMS ((const void *, const void *));
 
 static struct partial_symtab *
-new_psymtab PARAMS ((char *, struct objfile *));
+new_psymtab PARAMS ((char *, struct objfile *, struct section_offsets *));
 
 static void
 psymtab_to_symtab_1 PARAMS ((struct partial_symtab *, char *));
@@ -354,6 +354,9 @@ add_line PARAMS ((struct linetable *, int, CORE_ADDR, int));
 static struct linetable *
 shrink_linetable PARAMS ((struct linetable *));
 
+static void
+handle_psymbol_enumerators PARAMS ((struct objfile *, FDR *, int));
+
 static char *
 mdebug_next_symbol_text PARAMS ((void));
 \f
@@ -2060,7 +2063,7 @@ parse_partial_symbols (objfile, section_offsets)
   old_chain = make_cleanup (free, fdr_to_pst);
   fdr_to_pst++;
   {
-    struct partial_symtab *pst = new_psymtab ("", objfile);
+    struct partial_symtab *pst = new_psymtab ("", objfile, section_offsets);
     fdr_to_pst[-1].pst = pst;
     FDR_IDX (pst) = -1;
   }
@@ -2425,6 +2428,8 @@ parse_partial_symbols (objfile, section_offsets)
                                           sh.value,
                                           psymtab_language, objfile);
                    }
+                 handle_psymbol_enumerators (objfile, fh, sh.st);
+
                  /* Skip over the block */
                  new_sdx = sh.index;
                  if (new_sdx <= cur_sdx)
@@ -2575,6 +2580,68 @@ parse_partial_symbols (objfile, section_offsets)
   do_cleanups (old_chain);
 }
 
+/* If the current psymbol has an enumerated type, we need to add
+   all the the enum constants to the partial symbol table.  */
+
+static void
+handle_psymbol_enumerators (objfile, fh, stype)
+     struct objfile *objfile;
+     FDR *fh;
+     int stype;
+{
+  const bfd_size_type external_sym_size = debug_swap->external_sym_size;
+  void (* const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *))
+    = debug_swap->swap_sym_in;
+  char *ext_sym = ((char *) debug_info->external_sym
+                 + ((fh->isymBase + cur_sdx + 1) * external_sym_size));
+  SYMR sh;
+  TIR tir;
+
+  switch (stype)
+    {
+    case stEnum:
+      break;
+
+    case stBlock:
+      /* It is an enumerated type if the next symbol entry is a stMember
+        and its auxiliary index is indexNil or its auxiliary entry
+        is a plain btNil or btVoid.  */
+      (*swap_sym_in) (cur_bfd, ext_sym, &sh);
+      if (sh.st != stMember)
+       return;
+
+      if (sh.index == indexNil)
+       break;
+      ecoff_swap_tir_in (fh->fBigendian,
+                        &(debug_info->external_aux
+                          + fh->iauxBase + sh.index)->a_ti,
+                        &tir);
+      if ((tir.bt != btNil && tir.bt != btVoid) || tir.tq0 != tqNil)
+       return;
+      break;
+
+    default:
+      return;
+    }
+
+  for (;;)
+    {
+      char *name;
+
+      (*swap_sym_in) (cur_bfd, ext_sym, &sh);
+      if (sh.st != stMember)
+       break;
+      name = debug_info->ss + cur_fdr->issBase + sh.iss;
+
+      /* Note that the value doesn't matter for enum constants
+        in psymtabs, just in symtabs.  */
+      ADD_PSYMBOL_TO_LIST (name, strlen (name),
+                          VAR_NAMESPACE, LOC_CONST,
+                          objfile->static_psymbols, 0,
+                          psymtab_language, objfile);
+      ext_sym += external_sym_size;
+    }
+}
 
 static char *
 mdebug_next_symbol_text ()
@@ -3355,13 +3422,15 @@ new_symtab (name, maxsyms, maxlines, objfile)
 /* Allocate a new partial_symtab NAME */
 
 static struct partial_symtab *
-new_psymtab (name, objfile)
+new_psymtab (name, objfile, section_offsets)
      char *name;
      struct objfile *objfile;
+     struct section_offsets *section_offsets;
 {
   struct partial_symtab *psymtab;
 
   psymtab = allocate_psymtab (name, objfile);
+  psymtab->section_offsets = section_offsets;
 
   /* Keep a backpointer to the file's symbols */