2000-02-27 Eli Zaretskii <eliz@is.elta.co.il>
[deliverable/binutils-gdb.git] / binutils / rdcoff.c
index 9f7660b278e95699a6d809810d93d9b4110f2fb1..d1ee6e620f5f82eef5460c48d0ebc35b8ce7960a 100644 (file)
@@ -1,5 +1,5 @@
 /* stabs.c -- Parse COFF debugging information
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -199,6 +199,12 @@ parse_coff_type (abfd, symbols, types, coff_symno, ntype, pauxent, useaux,
                                                              NULL, dhandle),
                                        0, n - 1, false);
        }
+      else
+       {
+         fprintf (stderr, _("%s: parse_coff_type: Bad type code 0x%x\n"),
+                  program_name, ntype);
+         return DEBUG_TYPE_NULL;
+       }
 
       return type;
     }
@@ -414,7 +420,7 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
 
       if (! bfd_coff_get_syment (abfd, sym, &syment))
        {
-         fprintf (stderr, "%s: bfd_coff_get_syment failed: %s\n",
+         fprintf (stderr, _("%s: bfd_coff_get_syment failed: %s\n"),
                   program_name, bfd_errmsg (bfd_get_error ()));
          return DEBUG_TYPE_NULL;
        }
@@ -430,7 +436,7 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
        {
          if (! bfd_coff_get_auxent (abfd, sym, 0, &auxent))
            {
-             fprintf (stderr, "%s: bfd_coff_get_auxent failed: %s\n",
+             fprintf (stderr, _("%s: bfd_coff_get_auxent failed: %s\n"),
                       program_name, bfd_errmsg (bfd_get_error ()));
              return DEBUG_TYPE_NULL;
            }
@@ -492,7 +498,7 @@ static debug_type
 parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
      bfd *abfd;
      struct coff_symbols *symbols;
-     struct coff_types *types;
+     struct coff_types *types ATTRIBUTE_UNUSED;
      union internal_auxent *pauxent;
      PTR dhandle;
 {
@@ -522,7 +528,7 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
 
       if (! bfd_coff_get_syment (abfd, sym, &syment))
        {
-         fprintf (stderr, "%s: bfd_coff_get_syment failed: %s\n",
+         fprintf (stderr, _("%s: bfd_coff_get_syment failed: %s\n"),
                   program_name, bfd_errmsg (bfd_get_error ()));
          return DEBUG_TYPE_NULL;
        }
@@ -563,7 +569,7 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
 static boolean
 parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
                   within_function)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      struct coff_types *types;
      asymbol *sym;
      long coff_symno;
@@ -668,6 +674,7 @@ parse_coff (abfd, syms, symcount, dhandle)
   const char *fnname;
   int fnclass;
   int fntype;
+  bfd_vma fnend;
   alent *linenos;
   boolean within_function;
   long this_coff_symno;
@@ -685,6 +692,7 @@ parse_coff (abfd, syms, symcount, dhandle)
   fnname = NULL;
   fnclass = 0;
   fntype = 0;
+  fnend = 0;
   linenos = NULL;
   within_function = false;
 
@@ -701,7 +709,7 @@ parse_coff (abfd, syms, symcount, dhandle)
 
       if (! bfd_coff_get_syment (abfd, sym, &syment))
        {
-         fprintf (stderr, "%s: bfd_coff_get_syment failed: %s\n",
+         fprintf (stderr, _("%s: bfd_coff_get_syment failed: %s\n"),
                   program_name, bfd_errmsg (bfd_get_error ()));
          return false;
        }
@@ -721,7 +729,7 @@ parse_coff (abfd, syms, symcount, dhandle)
        {
          if (! bfd_coff_get_auxent (abfd, sym, 0, &auxent))
            {
-             fprintf (stderr, "%s: bfd_coff_get_auxent failed: %s\n",
+             fprintf (stderr, _("%s: bfd_coff_get_auxent failed: %s\n"),
                       program_name, bfd_errmsg (bfd_get_error ()));
              return false;
            }
@@ -766,6 +774,10 @@ parse_coff (abfd, syms, symcount, dhandle)
              fnname = name;
              fnclass = syment.n_sclass;
              fntype = syment.n_type;
+             if (syment.n_numaux > 0)
+               fnend = bfd_asymbol_value (sym) + auxent.x_sym.x_misc.x_fsize;
+             else
+               fnend = 0;
              linenos = BFD_SEND (abfd, _get_lineno, (abfd, sym));
              break;
            }
@@ -783,7 +795,7 @@ parse_coff (abfd, syms, symcount, dhandle)
            {
              if (fnname == NULL)
                {
-                 fprintf (stderr, "%s: %ld: .bf without preceding function\n",
+                 fprintf (stderr, _("%s: %ld: .bf without preceding function\n"),
                           program_name, this_coff_symno);
                  return false;
                }
@@ -833,14 +845,17 @@ parse_coff (abfd, syms, symcount, dhandle)
            {
              if (! within_function)
                {
-                 fprintf (stderr, "%s: %ld: unexpected .ef\n",
+                 fprintf (stderr, _("%s: %ld: unexpected .ef\n"),
                           program_name, this_coff_symno);
                  return false;
                }
 
-             if (! debug_end_function (dhandle, bfd_asymbol_value (sym)))
+             if (bfd_asymbol_value (sym) > fnend)
+               fnend = bfd_asymbol_value (sym);
+             if (! debug_end_function (dhandle, fnend))
                return false;
 
+             fnend = 0;
              within_function = false;
            }
          break;
This page took 0.042414 seconds and 4 git commands to generate.