* config/m68k/monitor.mt (TDEPFILE): Add remote-es.o.
[deliverable/binutils-gdb.git] / gdb / mdebugread.c
index bbeb66dcc634d7f8ae60bb21040ad4e40ebce90f..352b4c4a8db5a487d557e5dd21bb37c8ef0e6ecf 100644 (file)
@@ -993,8 +993,10 @@ parse_symbol (sh, ax, ext_sh, bigend)
        else
          t = pend->t;
 
-       /* Alpha cc unnamed structs do not get a tag name.  */
-       if (sh->iss == 0)
+       /* Do not set the tag name if it is a compiler generated tag name
+          (.Fxx or .xxfake or empty) for unnamed struct/union/enums.
+          Alpha cc puts out an sh->iss of zero for those.  */
+       if (sh->iss == 0 || name[0] == '.' || name[0] == '\0')
          TYPE_TAG_NAME (t) = NULL;
        else
          TYPE_TAG_NAME (t) = obconcat (&current_objfile->symbol_obstack,
@@ -1010,6 +1012,15 @@ parse_symbol (sh, ax, ext_sh, bigend)
        if (type_code == TYPE_CODE_ENUM)
          {
            /* This is a non-empty enum. */
+
+           /* DEC c89 has the number of enumerators in the sh.value field,
+              not the type length, so we have to compensate for that
+              incompatibility quirk.
+              This might do the wrong thing for an enum with one or two
+              enumerators and gcc -gcoff -fshort-enums, but these cases
+              are hopefully rare enough.  */
+           if (TYPE_LENGTH (t) == TYPE_NFIELDS (t))
+             TYPE_LENGTH (t) = TARGET_INT_BIT / HOST_CHAR_BIT;
            for (ext_tsym = ext_sh + external_sym_size;
                 ;
                 ext_tsym += external_sym_size)
@@ -1416,6 +1427,12 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
       if (tp == (struct type *) NULL)
        tp = init_type (type_code, 0, 0, (char *) NULL, current_objfile);
 
+      /* DEC c89 produces cross references to qualified aggregate types,
+        dereference them.  */
+      while (TYPE_CODE (tp) == TYPE_CODE_PTR
+            || TYPE_CODE (tp) == TYPE_CODE_ARRAY)
+       tp = tp->target_type;
+
       /* Make sure that TYPE_CODE(tp) has an expected type code.
         Any type may be returned from cross_ref if file indirect entries
         are corrupted.  */
@@ -1695,6 +1712,7 @@ parse_procedure (pr, search_symtab, first_off)
       if (pr->isym == -1)
        {
          /* Static procedure at address pr->adr.  Sigh. */
+         /* FIXME-32x64.  assuming pr->adr fits in long.  */
          complain (&pdr_static_symbol_complaint, (unsigned long) pr->adr);
          return;
        }
@@ -2730,10 +2748,17 @@ psymtab_to_symtab_1 (pst, filename)
                  add_symbol_to_list (s, &local_symbols);
                }
            }
-         else if (sh.st == stLabel && sh.index != indexNil)
+         else if (sh.st == stLabel)
            {
-             /* Handle encoded stab line number. */
-             record_line (current_subfile, sh.index, valu);
+             if (sh.index == indexNil)
+               {
+                 /* This is what the gcc2_compiled and __gnu_compiled_*
+                    show up as.  So don't complain.  */
+                 ;
+               }
+             else
+               /* Handle encoded stab line number. */
+               record_line (current_subfile, sh.index, valu);
            }
          else if (sh.st == stProc || sh.st == stStaticProc || sh.st == stEnd)
            /* These are generated by gcc-2.x, do not complain */
@@ -3222,6 +3247,10 @@ add_line (lt, lineno, adr, last)
      CORE_ADDR adr;
      int last;
 {
+  /* DEC c89 sometimes produces zero linenos which confuse gdb.
+     Change them to something sensible. */
+  if (lineno == 0)
+    lineno = 1;
   if (last == 0)
     last = -2;                 /* make sure we record first line */
 
This page took 0.02398 seconds and 4 git commands to generate.