aboutsummaryrefslogtreecommitdiff
path: root/gdb/hppa-tdep.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-04-10 10:43:32 -0600
committerTom Tromey <tom@tromey.com>2023-05-07 12:44:17 -0600
commit5250cbc85cbbf13221ed508c1b89f1ee0a6ac1ec (patch)
tree36230d533899f8a7459c129e1691944d82209b99 /gdb/hppa-tdep.c
parent9ed8433a04bf0430e2da3cd44c18667859782410 (diff)
downloadbinutils-5250cbc85cbbf13221ed508c1b89f1ee0a6ac1ec.zip
binutils-5250cbc85cbbf13221ed508c1b89f1ee0a6ac1ec.tar.gz
binutils-5250cbc85cbbf13221ed508c1b89f1ee0a6ac1ec.tar.bz2
Remove ALL_OBJFILE_OSECTIONS
This replaces ALL_OBJFILE_OSECTIONS with an iterator so that for-each can be used.
Diffstat (limited to 'gdb/hppa-tdep.c')
-rw-r--r--gdb/hppa-tdep.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index d054e80..b7c96e8 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -910,7 +910,7 @@ static CORE_ADDR
hppa64_convert_code_addr_to_fptr (struct gdbarch *gdbarch, CORE_ADDR code)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- struct obj_section *sec, *opd;
+ struct obj_section *sec;
sec = find_pc_section (code);
@@ -921,25 +921,24 @@ hppa64_convert_code_addr_to_fptr (struct gdbarch *gdbarch, CORE_ADDR code)
if (!(sec->the_bfd_section->flags & SEC_CODE))
return code;
- ALL_OBJFILE_OSECTIONS (sec->objfile, opd)
+ for (obj_section *opd : sec->objfile->sections ())
{
if (strcmp (opd->the_bfd_section->name, ".opd") == 0)
- break;
- }
-
- if (opd < sec->objfile->sections_end)
- {
- for (CORE_ADDR addr = opd->addr (); addr < opd->endaddr (); addr += 2 * 8)
{
- ULONGEST opdaddr;
- gdb_byte tmp[8];
+ for (CORE_ADDR addr = opd->addr ();
+ addr < opd->endaddr ();
+ addr += 2 * 8)
+ {
+ ULONGEST opdaddr;
+ gdb_byte tmp[8];
- if (target_read_memory (addr, tmp, sizeof (tmp)))
- break;
- opdaddr = extract_unsigned_integer (tmp, sizeof (tmp), byte_order);
+ if (target_read_memory (addr, tmp, sizeof (tmp)))
+ break;
+ opdaddr = extract_unsigned_integer (tmp, sizeof (tmp), byte_order);
- if (opdaddr == code)
- return addr - 16;
+ if (opdaddr == code)
+ return addr - 16;
+ }
}
}