aboutsummaryrefslogtreecommitdiff
path: root/gdb/dbxread.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-08-09 09:58:36 +0930
committerAlan Modra <amodra@gmail.com>2023-08-11 22:16:32 +0930
commit2db20b97f1dc3e5dce3d6ed74a8a62f0dede8c80 (patch)
tree255302b03f963939d9de59310a2e9c6dbe2ee86a /gdb/dbxread.c
parent19c5c1bb327dbb5c88cd52571896c56296f5a308 (diff)
downloadgdb-2db20b97f1dc3e5dce3d6ed74a8a62f0dede8c80.zip
gdb-2db20b97f1dc3e5dce3d6ed74a8a62f0dede8c80.tar.gz
gdb-2db20b97f1dc3e5dce3d6ed74a8a62f0dede8c80.tar.bz2
gdb: warn unused result for bfd IO functions
This fixes the compilation warnings introduced by my bfdio.c patch. The removed bfd_seeks in coff_symfile_read date back to 1994, commit 7f4c859520, prior to which the file used stdio rather than bfd to read symbols. Since it now uses bfd to read the file there should be no need to synchronise to bfd's idea of the file position. I also fixed a potential uninitialised memory access. Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r--gdb/dbxread.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 75bbd51..ddc61d9 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -809,7 +809,8 @@ stabs_seek (int sym_offset)
symbuf_left -= sym_offset;
}
else
- bfd_seek (symfile_bfd, sym_offset, SEEK_CUR);
+ if (bfd_seek (symfile_bfd, sym_offset, SEEK_CUR) != 0)
+ perror_with_name (bfd_get_filename (symfile_bfd));
}
#define INTERNALIZE_SYMBOL(intern, extern, abfd) \
@@ -2155,8 +2156,8 @@ dbx_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
symbol_size = SYMBOL_SIZE (pst);
/* Read in this file's symbols. */
- bfd_seek (objfile->obfd.get (), SYMBOL_OFFSET (pst), SEEK_SET);
- read_ofile_symtab (objfile, pst);
+ if (bfd_seek (objfile->obfd.get (), SYMBOL_OFFSET (pst), SEEK_SET) == 0)
+ read_ofile_symtab (objfile, pst);
}
pst->readin = true;