* dbxread.c: Likewise.
* dwarf2read.c: Likewise.
* dwarfread.c: Likewise.
* somread.c: Likewise.
* ultra3-nat.c: Likewise.
* xcoffread.c: Likewise.
+2001-09-20 Alan Modra <amodra@bigpond.net.au>
+
+ * coffread.c: Replace all occurrences of bfd_read with bfd_bread.
+ * dbxread.c: Likewise.
+ * dwarf2read.c: Likewise.
+ * dwarfread.c: Likewise.
+ * somread.c: Likewise.
+ * ultra3-nat.c: Likewise.
+ * xcoffread.c: Likewise.
+
2001-09-19 Andrew Cagney <ac131313@redhat.com>
* cris-tdep.c (cris_get_signed_offset): Change return type to an
/* Read coff symbol tables and convert to internal format, for GDB.
Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000
+ 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Contributed by David D. Johnson, Brown University (ddj@cs.brown.edu).
int i;
cs->c_symnum = symnum;
- bfd_read (temp_sym, local_symesz, 1, nlist_bfd_global);
+ bfd_bread (temp_sym, local_symesz, nlist_bfd_global);
bfd_coff_swap_sym_in (symfile_bfd, temp_sym, (char *) sym);
cs->c_naux = sym->n_numaux & 0xff;
if (cs->c_naux >= 1)
{
- bfd_read (temp_aux, local_auxesz, 1, nlist_bfd_global);
+ bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
bfd_coff_swap_aux_in (symfile_bfd, temp_aux, sym->n_type, sym->n_sclass,
0, cs->c_naux, (char *) aux);
/* If more than one aux entry, read past it (only the first aux
is important). */
for (i = 1; i < cs->c_naux; i++)
- bfd_read (temp_aux, local_auxesz, 1, nlist_bfd_global);
+ bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
}
cs->c_name = getsymname (sym);
cs->c_value = sym->n_value;
if (bfd_seek (abfd, offset, 0) < 0)
return -1;
- val = bfd_read ((char *) lengthbuf, sizeof lengthbuf, 1, abfd);
+ val = bfd_bread ((char *) lengthbuf, sizeof lengthbuf, abfd);
length = bfd_h_get_32 (symfile_bfd, lengthbuf);
/* If no string table is needed, then the file may end immediately
if (length == sizeof length) /* Empty table -- just the count */
return 0;
- val = bfd_read (stringtab + sizeof lengthbuf, length - sizeof lengthbuf, 1, abfd);
+ val = bfd_bread (stringtab + sizeof lengthbuf, length - sizeof lengthbuf,
+ abfd);
if (val != length - sizeof lengthbuf || stringtab[length - 1] != '\0')
return -1;
/* Allocate the desired table, plus a sentinel */
linetab = (char *) xmalloc (size + local_linesz);
- val = bfd_read (linetab, size, 1, abfd);
+ val = bfd_bread (linetab, size, abfd);
if (val != size)
return -1;
perror_with_name (name);
memset ((PTR) size_temp, 0, sizeof (size_temp));
- val = bfd_read ((PTR) size_temp, sizeof (size_temp), 1, sym_bfd);
+ val = bfd_bread ((PTR) size_temp, sizeof (size_temp), sym_bfd);
if (val < 0)
{
perror_with_name (name);
val = bfd_seek (sym_bfd, STRING_TABLE_OFFSET, SEEK_SET);
if (val < 0)
perror_with_name (name);
- val = bfd_read (DBX_STRINGTAB (objfile), DBX_STRINGTAB_SIZE (objfile), 1,
- sym_bfd);
+ val = bfd_bread (DBX_STRINGTAB (objfile),
+ DBX_STRINGTAB_SIZE (objfile),
+ sym_bfd);
if (val != DBX_STRINGTAB_SIZE (objfile))
perror_with_name (name);
}
count = sizeof (symbuf);
}
- nbytes = bfd_read ((PTR) symbuf, count, 1, sym_bfd);
+ nbytes = bfd_bread ((PTR) symbuf, count, sym_bfd);
if (nbytes < 0)
perror_with_name (bfd_get_filename (sym_bfd));
else if (nbytes == 0)
val = bfd_seek (sym_bfd, stabstroffset, SEEK_SET);
if (val < 0)
perror_with_name (name);
- val = bfd_read (DBX_STRINGTAB (objfile), stabstrsize, 1, sym_bfd);
+ val = bfd_bread (DBX_STRINGTAB (objfile), stabstrsize, sym_bfd);
if (val != stabstrsize)
perror_with_name (name);
val = bfd_seek (sym_bfd, stabstroffset, SEEK_SET);
if (val < 0)
perror_with_name (name);
- val = bfd_read (DBX_STRINGTAB (objfile), stabstrsize, 1, sym_bfd);
+ val = bfd_bread (DBX_STRINGTAB (objfile), stabstrsize, sym_bfd);
if (val != stabstrsize)
perror_with_name (name);
buf = (char *) obstack_alloc (&objfile->psymbol_obstack, size);
if ((bfd_seek (abfd, offset, SEEK_SET) != 0) ||
- (bfd_read (buf, size, 1, abfd) != size))
+ (bfd_bread (buf, size, abfd) != size))
{
buf = NULL;
error ("Dwarf Error: Can't read DWARF data from '%s'",
dbbase = xmalloc (dbsize);
dbroff = 0;
if ((bfd_seek (abfd, dbfoff, SEEK_SET) != 0) ||
- (bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
+ (bfd_bread (dbbase, dbsize, abfd) != dbsize))
{
xfree (dbbase);
error ("can't read DWARF data from '%s'", bfd_get_filename (abfd));
base_section_offsets = pst->section_offsets;
baseaddr = ANOFFSET (pst->section_offsets, 0);
if (bfd_seek (abfd, foffset, SEEK_SET) ||
- (bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
+ (bfd_bread (dbbase, dbsize, abfd) != dbsize))
{
xfree (dbbase);
error ("can't read DWARF data");
if (LNFOFF (pst))
{
if (bfd_seek (abfd, LNFOFF (pst), SEEK_SET) ||
- (bfd_read ((PTR) lnsizedata, sizeof (lnsizedata), 1, abfd) !=
- sizeof (lnsizedata)))
+ (bfd_bread ((PTR) lnsizedata, sizeof (lnsizedata), abfd)
+ != sizeof (lnsizedata)))
{
error ("can't read DWARF line number table size");
}
GET_UNSIGNED, pst->objfile);
lnbase = xmalloc (lnsize);
if (bfd_seek (abfd, LNFOFF (pst), SEEK_SET) ||
- (bfd_read (lnbase, lnsize, 1, abfd) != lnsize))
+ (bfd_bread (lnbase, lnsize, abfd) != lnsize))
{
xfree (lnbase);
error ("can't read DWARF line numbers");
/* Read HP PA/Risc object files for GDB.
- Copyright 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000
+ Copyright 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
buf = alloca (symsize * number_of_symbols);
bfd_seek (abfd, obj_som_sym_filepos (abfd), SEEK_SET);
- val = bfd_read (buf, symsize * number_of_symbols, 1, abfd);
+ val = bfd_bread (buf, symsize * number_of_symbols, abfd);
if (val != symsize * number_of_symbols)
error ("Couldn't read symbol dictionary!");
stringtab = alloca (obj_som_stringtab_size (abfd));
bfd_seek (abfd, obj_som_str_filepos (abfd), SEEK_SET);
- val = bfd_read (stringtab, obj_som_stringtab_size (abfd), 1, abfd);
+ val = bfd_bread (stringtab, obj_som_stringtab_size (abfd), abfd);
if (val != obj_som_stringtab_size (abfd))
error ("Can't read in HP string table.");
/* OBSOLETE if (!CANNOT_FETCH_REGISTER (regno)) */
/* OBSOLETE { */
/* OBSOLETE val = bfd_seek (core_bfd, (file_ptr) register_addr (regno, 0), SEEK_SET); */
-/* OBSOLETE if (val < 0 || (val = bfd_read (buf, sizeof buf, 1, core_bfd)) < 0) */
+/* OBSOLETE if (val != 0 || (val = bfd_bread (buf, sizeof buf, core_bfd)) != sizeof buf) */
/* OBSOLETE { */
/* OBSOLETE char *buffer = (char *) alloca (strlen (REGISTER_NAME (regno)) + 35); */
/* OBSOLETE strcpy (buffer, "Reading core register "); */
/* Read AIX xcoff symbol tables and convert to internal format, for GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000
+ 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Derived from coffread.c, dbxread.c, and a lot of hacking.
Contributed by IBM Corporation.
while (curoffset <= limit_offset)
{
bfd_seek (abfd, curoffset, SEEK_SET);
- bfd_read (ext_lnno, linesz, 1, abfd);
+ bfd_bread (ext_lnno, linesz, abfd);
bfd_coff_swap_lineno_in (abfd, ext_lnno, &int_lnno);
/* Find the address this line represents. */
error ("cannot seek to string table in %s: %s",
bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ()));
- val = bfd_read ((char *) lengthbuf, 1, sizeof lengthbuf, abfd);
+ val = bfd_bread ((char *) lengthbuf, sizeof lengthbuf, abfd);
length = bfd_h_get_32 (abfd, lengthbuf);
/* If no string table is needed, then the file may end immediately
if (length == sizeof lengthbuf)
return;
- val = bfd_read (strtbl + sizeof lengthbuf, 1, length - sizeof lengthbuf,
- abfd);
+ val = bfd_bread (strtbl + sizeof lengthbuf, length - sizeof lengthbuf, abfd);
if (val != length - sizeof lengthbuf)
error ("cannot read string table from %s: %s",
((struct coff_symfile_info *) objfile->sym_private)->symtbl_num_syms =
num_symbols;
- val = bfd_read (((struct coff_symfile_info *) objfile->sym_private)->symtbl,
- size, 1, abfd);
+ val = bfd_bread (((struct coff_symfile_info *) objfile->sym_private)->symtbl,
+ size, abfd);
if (val != size)
perror_with_name ("reading symbol table");