* paread.c (pa_symfile_init): If error reading string table, don't
authorJim Kingdon <jkingdon@engr.sgi.com>
Thu, 29 Jul 1993 19:19:30 +0000 (19:19 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Thu, 29 Jul 1993 19:19:30 +0000 (19:19 +0000)
use errno in cases where it hasn't been set.

gdb/ChangeLog
gdb/paread.c

index 01e10e9741eaa319a3dc21f516c99ce1c42b7983..42c41306a6f4d54fcc0f290ca12fc38146c7219f 100644 (file)
@@ -1,5 +1,8 @@
 Thu Jul 29 12:09:46 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
+       * paread.c (pa_symfile_init): If error reading string table, don't
+       use errno in cases where it hasn't been set.
+
        * ser-unix.c (gdb_setpgid): Pass our pid, not 0, to setpgid.
 
        * remote-monitor.c (_initialize_monitor): Comment out use of
index 46a6e3d2537001495251391fa7a8bbcdcb6c6be8..150757effb158ca52f51a2f57ea77a976f9f3c14 100644 (file)
@@ -399,8 +399,14 @@ pa_symfile_init (objfile)
     perror_with_name (name);
   val = bfd_read (DBX_STRINGTAB (objfile), DBX_STRINGTAB_SIZE (objfile), 1,
                  sym_bfd);
-  if (val != DBX_STRINGTAB_SIZE (objfile))
+  if (val == 0)
+    error ("End of file reading string table");
+  else if (val < 0)
+    /* It's possible bfd_read should be setting bfd_error, and we should be
+       checking that.  But currently it doesn't set bfd_error.  */
     perror_with_name (name);
+  else if (val != DBX_STRINGTAB_SIZE (objfile))
+    error ("Short read reading string table");
 }
 
 /* PA specific parsing routine for section offsets.
This page took 0.027183 seconds and 4 git commands to generate.