aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-08-07 14:40:35 +0930
committerAlan Modra <amodra@gmail.com>2023-08-09 08:48:09 +0930
commit226f9f4fadb087875ef98a0a55d614236c6241b3 (patch)
treee6c63b104143dd86acf739d5633649582668224e /gdb
parentfeddea4b466ce4f2bb2301fd2d4bef56e8d09ccc (diff)
downloadbinutils-226f9f4fadb087875ef98a0a55d614236c6241b3.zip
binutils-226f9f4fadb087875ef98a0a55d614236c6241b3.tar.gz
binutils-226f9f4fadb087875ef98a0a55d614236c6241b3.tar.bz2
Rename bfd_bread and bfd_bwrite
These were renamed from bfd_read and bfd_write back in 2001 when they lost an unnecessary parameter. Rename them back, and get rid of a few casts that are only needed without prototyped functions (K&R C).
Diffstat (limited to 'gdb')
-rw-r--r--gdb/coff-pe-read.c12
-rw-r--r--gdb/coffread.c14
-rw-r--r--gdb/dbxread.c16
-rw-r--r--gdb/dwarf2/section.c2
-rw-r--r--gdb/gdb_bfd.c2
-rw-r--r--gdb/minidebug.c6
-rw-r--r--gdb/solib-svr4.c2
-rw-r--r--gdb/xcoffread.c8
8 files changed, 31 insertions, 31 deletions
diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c
index a6401c4..b82b43c 100644
--- a/gdb/coff-pe-read.c
+++ b/gdb/coff-pe-read.c
@@ -259,7 +259,7 @@ pe_get16 (bfd *abfd, int where)
unsigned char b[2];
bfd_seek (abfd, (file_ptr) where, SEEK_SET);
- bfd_bread (b, (bfd_size_type) 2, abfd);
+ bfd_read (b, (bfd_size_type) 2, abfd);
return b[0] + (b[1] << 8);
}
@@ -269,7 +269,7 @@ pe_get32 (bfd *abfd, int where)
unsigned char b[4];
bfd_seek (abfd, (file_ptr) where, SEEK_SET);
- bfd_bread (b, (bfd_size_type) 4, abfd);
+ bfd_read (b, (bfd_size_type) 4, abfd);
return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
}
@@ -379,7 +379,7 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
unsigned long fptr = pe_get32 (dll, secptr1 + 20);
bfd_seek (dll, (file_ptr) secptr1, SEEK_SET);
- bfd_bread (sname, (bfd_size_type) sizeof (sname), dll);
+ bfd_read (sname, (bfd_size_type) sizeof (sname), dll);
if ((strcmp (sname, ".edata") == 0)
|| (vaddr <= export_opthdrrva && export_opthdrrva < vaddr + vsize))
@@ -429,7 +429,7 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
asection *section;
bfd_seek (dll, (file_ptr) secptr1 + 0, SEEK_SET);
- bfd_bread (sec_name, (bfd_size_type) SCNNMLEN, dll);
+ bfd_read (sec_name, (bfd_size_type) SCNNMLEN, dll);
sec_name[SCNNMLEN] = '\0';
sectix = read_pe_section_index (sec_name);
@@ -469,7 +469,7 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
expdata = expdata_storage.data ();
bfd_seek (dll, (file_ptr) expptr, SEEK_SET);
- bfd_bread (expdata, (bfd_size_type) export_size, dll);
+ bfd_read (expdata, (bfd_size_type) export_size, dll);
erva = expdata - export_rva;
nexp = pe_as32 (expdata + 24);
@@ -639,7 +639,7 @@ pe_text_section_offset (struct bfd *abfd)
unsigned long vaddr = pe_get32 (abfd, secptr1 + 12);
bfd_seek (abfd, (file_ptr) secptr1, SEEK_SET);
- bfd_bread (sname, (bfd_size_type) SCNNMLEN, abfd);
+ bfd_read (sname, (bfd_size_type) SCNNMLEN, abfd);
sname[SCNNMLEN] = '\0';
if (strcmp (sname, ".text") == 0)
return vaddr;
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 6ec341c..583db6b 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -1224,14 +1224,14 @@ read_one_sym (struct coff_symbol *cs,
bfd_size_type bytes;
cs->c_symnum = symnum;
- bytes = bfd_bread (temp_sym, local_symesz, nlist_bfd_global);
+ bytes = bfd_read (temp_sym, local_symesz, nlist_bfd_global);
if (bytes != local_symesz)
error (_("%s: error reading symbols"), objfile_name (coffread_objfile));
bfd_coff_swap_sym_in (symfile_bfd, temp_sym, (char *) sym);
cs->c_naux = sym->n_numaux & 0xff;
if (cs->c_naux >= 1)
{
- bytes = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
+ bytes = bfd_read (temp_aux, local_auxesz, nlist_bfd_global);
if (bytes != local_auxesz)
error (_("%s: error reading symbols"), objfile_name (coffread_objfile));
bfd_coff_swap_aux_in (symfile_bfd, temp_aux,
@@ -1241,7 +1241,7 @@ read_one_sym (struct coff_symbol *cs,
is important). */
for (i = 1; i < cs->c_naux; i++)
{
- bytes = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
+ bytes = bfd_read (temp_aux, local_auxesz, nlist_bfd_global);
if (bytes != local_auxesz)
error (_("%s: error reading symbols"),
objfile_name (coffread_objfile));
@@ -1308,7 +1308,7 @@ init_stringtab (bfd *abfd, file_ptr offset, gdb::unique_xmalloc_ptr<char> *stora
if (bfd_seek (abfd, offset, 0) < 0)
return -1;
- val = bfd_bread ((char *) lengthbuf, sizeof lengthbuf, abfd);
+ val = bfd_read ((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
@@ -1324,8 +1324,8 @@ init_stringtab (bfd *abfd, file_ptr offset, gdb::unique_xmalloc_ptr<char> *stora
if (length == sizeof length) /* Empty table -- just the count. */
return 0;
- val = bfd_bread (stringtab + sizeof lengthbuf,
- length - sizeof lengthbuf, abfd);
+ val = bfd_read (stringtab + sizeof lengthbuf,
+ length - sizeof lengthbuf, abfd);
if (val != length - sizeof lengthbuf || stringtab[length - 1] != '\0')
return -1;
@@ -1409,7 +1409,7 @@ init_lineno (bfd *abfd, file_ptr offset, file_ptr size,
storage->reset ((char *) xmalloc (size + local_linesz));
linetab = storage->get ();
- val = bfd_bread (storage->get (), size, abfd);
+ val = bfd_read (storage->get (), size, abfd);
if (val != size)
return -1;
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index a0a08b1..75bbd51 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -640,7 +640,7 @@ dbx_symfile_init (struct objfile *objfile)
perror_with_name (name);
memset (size_temp, 0, sizeof (size_temp));
- val = bfd_bread (size_temp, sizeof (size_temp), sym_bfd);
+ val = bfd_read (size_temp, sizeof (size_temp), sym_bfd);
if (val < 0)
{
perror_with_name (name);
@@ -679,9 +679,9 @@ dbx_symfile_init (struct objfile *objfile)
val = bfd_seek (sym_bfd, STRING_TABLE_OFFSET, SEEK_SET);
if (val < 0)
perror_with_name (name);
- val = bfd_bread (DBX_STRINGTAB (objfile),
- DBX_STRINGTAB_SIZE (objfile),
- sym_bfd);
+ val = bfd_read (DBX_STRINGTAB (objfile),
+ DBX_STRINGTAB_SIZE (objfile),
+ sym_bfd);
if (val != DBX_STRINGTAB_SIZE (objfile))
perror_with_name (name);
}
@@ -769,7 +769,7 @@ fill_symbuf (bfd *sym_bfd)
else if (symbuf_sections == NULL)
{
count = sizeof (symbuf);
- nbytes = bfd_bread (symbuf, count, sym_bfd);
+ nbytes = bfd_read (symbuf, count, sym_bfd);
}
else
{
@@ -787,7 +787,7 @@ fill_symbuf (bfd *sym_bfd)
count = symbuf_left;
if (count > sizeof (symbuf))
count = sizeof (symbuf);
- nbytes = bfd_bread (symbuf, count, sym_bfd);
+ nbytes = bfd_read (symbuf, count, sym_bfd);
}
if (nbytes < 0)
@@ -3015,7 +3015,7 @@ coffstab_build_psymtabs (struct objfile *objfile,
val = bfd_seek (sym_bfd, stabstroffset, SEEK_SET);
if (val < 0)
perror_with_name (name);
- val = bfd_bread (DBX_STRINGTAB (objfile), stabstrsize, sym_bfd);
+ val = bfd_read (DBX_STRINGTAB (objfile), stabstrsize, sym_bfd);
if (val != stabstrsize)
perror_with_name (name);
@@ -3108,7 +3108,7 @@ elfstab_build_psymtabs (struct objfile *objfile, asection *stabsect,
val = bfd_seek (sym_bfd, stabstroffset, SEEK_SET);
if (val < 0)
perror_with_name (name);
- val = bfd_bread (DBX_STRINGTAB (objfile), stabstrsize, sym_bfd);
+ val = bfd_read (DBX_STRINGTAB (objfile), stabstrsize, sym_bfd);
if (val != stabstrsize)
perror_with_name (name);
diff --git a/gdb/dwarf2/section.c b/gdb/dwarf2/section.c
index c9ef418..1235f29 100644
--- a/gdb/dwarf2/section.c
+++ b/gdb/dwarf2/section.c
@@ -182,7 +182,7 @@ dwarf2_section_info::read (struct objfile *objfile)
gdb_assert (abfd != NULL);
if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0
- || bfd_bread (buf, size, abfd) != size)
+ || bfd_read (buf, size, abfd) != size)
{
error (_("Dwarf Error: Can't read DWARF data"
" in section %s [in module %s]"),
diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
index 9227a6c..3765561 100644
--- a/gdb/gdb_bfd.c
+++ b/gdb/gdb_bfd.c
@@ -838,7 +838,7 @@ get_file_crc (bfd *abfd, unsigned long *file_crc_return)
gdb_byte buffer[8 * 1024];
bfd_size_type count;
- count = bfd_bread (buffer, sizeof (buffer), abfd);
+ count = bfd_read (buffer, sizeof (buffer), abfd);
if (count == (bfd_size_type) -1)
{
warning (_("Problem reading \"%s\" for CRC: %s"),
diff --git a/gdb/minidebug.c b/gdb/minidebug.c
index 53d34d3..a3ab0e3 100644
--- a/gdb/minidebug.c
+++ b/gdb/minidebug.c
@@ -95,7 +95,7 @@ lzma_open (struct bfd *nbfd, void *open_closure)
offset = section->filepos + size - LZMA_STREAM_HEADER_SIZE;
if (size < LZMA_STREAM_HEADER_SIZE
|| bfd_seek (section->owner, offset, SEEK_SET) != 0
- || bfd_bread (footer, LZMA_STREAM_HEADER_SIZE, section->owner)
+ || bfd_read (footer, LZMA_STREAM_HEADER_SIZE, section->owner)
!= LZMA_STREAM_HEADER_SIZE
|| lzma_stream_footer_decode (&options, footer) != LZMA_OK
|| offset < options.backward_size)
@@ -109,7 +109,7 @@ lzma_open (struct bfd *nbfd, void *open_closure)
index = NULL;
pos = 0;
if (bfd_seek (section->owner, offset, SEEK_SET) != 0
- || bfd_bread (indexdata, options.backward_size, section->owner)
+ || bfd_read (indexdata, options.backward_size, section->owner)
!= options.backward_size
|| lzma_index_buffer_decode (&index, &memlimit, &gdb_lzma_allocator,
indexdata, &pos, options.backward_size)
@@ -162,7 +162,7 @@ lzma_pread (struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes,
compressed = (gdb_byte *) xmalloc (iter.block.total_size);
block_offset = section->filepos + iter.block.compressed_file_offset;
if (bfd_seek (section->owner, block_offset, SEEK_SET) != 0
- || bfd_bread (compressed, iter.block.total_size, section->owner)
+ || bfd_read (compressed, iter.block.total_size, section->owner)
!= iter.block.total_size)
{
xfree (compressed);
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index f1fa437..f5fdbc7 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -2634,7 +2634,7 @@ read_program_headers_from_bfd (bfd *abfd)
gdb::byte_vector buf (phdrs_size);
if (bfd_seek (abfd, ehdr->e_phoff, SEEK_SET) != 0
- || bfd_bread (buf.data (), phdrs_size, abfd) != phdrs_size)
+ || bfd_read (buf.data (), phdrs_size, abfd) != phdrs_size)
return {};
return buf;
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 8930cf1..8ce4b28 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -780,7 +780,7 @@ enter_line_range (struct subfile *subfile, unsigned beginoffset,
while (curoffset <= limit_offset)
{
bfd_seek (abfd, curoffset, SEEK_SET);
- bfd_bread (ext_lnno, linesz, abfd);
+ bfd_read (ext_lnno, linesz, abfd);
bfd_coff_swap_lineno_in (abfd, ext_lnno, &int_lnno);
/* Find the address this line represents. */
@@ -1827,7 +1827,7 @@ init_stringtab (bfd *abfd, file_ptr offset, struct objfile *objfile)
error (_("cannot seek to string table in %s: %s"),
bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ()));
- val = bfd_bread ((char *) lengthbuf, sizeof lengthbuf, abfd);
+ val = bfd_read ((char *) lengthbuf, sizeof lengthbuf, abfd);
length = bfd_h_get_32 (abfd, lengthbuf);
/* If no string table is needed, then the file may end immediately
@@ -1848,7 +1848,7 @@ init_stringtab (bfd *abfd, file_ptr offset, struct objfile *objfile)
if (length == sizeof lengthbuf)
return;
- val = bfd_bread (strtbl + sizeof lengthbuf, length - sizeof lengthbuf, abfd);
+ val = bfd_read (strtbl + sizeof lengthbuf, length - sizeof lengthbuf, abfd);
if (val != length - sizeof lengthbuf)
error (_("cannot read string table from %s: %s"),
@@ -2848,7 +2848,7 @@ xcoff_initial_scan (struct objfile *objfile, symfile_add_flags symfile_flags)
info->symtbl = (char *) obstack_alloc (&objfile->objfile_obstack, size);
info->symtbl_num_syms = num_symbols;
- val = bfd_bread (info->symtbl, size, abfd);
+ val = bfd_read (info->symtbl, size, abfd);
if (val != size)
perror_with_name (_("reading symbol table"));