diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-07-29 19:19:30 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-07-29 19:19:30 +0000 |
commit | 93af329a003e753a45d48d7ce571409f6fdc7713 (patch) | |
tree | 80958be50450ac37351fbda55ea614ff1ed8c269 /gdb/paread.c | |
parent | d4c22c52330c6dd6ba3a1f723a19786a16102c83 (diff) | |
download | gdb-93af329a003e753a45d48d7ce571409f6fdc7713.zip gdb-93af329a003e753a45d48d7ce571409f6fdc7713.tar.gz gdb-93af329a003e753a45d48d7ce571409f6fdc7713.tar.bz2 |
* paread.c (pa_symfile_init): If error reading string table, don't
use errno in cases where it hasn't been set.
Diffstat (limited to 'gdb/paread.c')
-rw-r--r-- | gdb/paread.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/paread.c b/gdb/paread.c index 46a6e3d..150757e 100644 --- a/gdb/paread.c +++ b/gdb/paread.c @@ -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. |