diff options
author | Tom Tromey <tom@tromey.com> | 2020-09-19 11:54:49 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-09-19 11:54:53 -0600 |
commit | f4f2b85fb2eab29ea981b2c3f2058c1dc04e413c (patch) | |
tree | 829b85f168c31d6f6326b257df174556c556bec5 /gdb | |
parent | b35c1d1cf457db034186f321517eee69ef8457a5 (diff) | |
download | gdb-f4f2b85fb2eab29ea981b2c3f2058c1dc04e413c.zip gdb-f4f2b85fb2eab29ea981b2c3f2058c1dc04e413c.tar.gz gdb-f4f2b85fb2eab29ea981b2c3f2058c1dc04e413c.tar.bz2 |
Use gdb_bfd_sections in gcore_memory_sections
This changes gcore_memory_sections to avoid bfd_map_over_sections, in
favor of iteration.
gdb/ChangeLog
2020-09-19 Tom Tromey <tom@tromey.com>
* gcore.c (make_output_phdrs): Remove 'ignored' parameter.
(gcore_copy_callback): Likewise.
(gcore_memory_sections): Use foreach.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/gcore.c | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1fb3c88..eaffc9d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2020-09-19 Tom Tromey <tom@tromey.com> + * gcore.c (make_output_phdrs): Remove 'ignored' parameter. + (gcore_copy_callback): Likewise. + (gcore_memory_sections): Use foreach. + +2020-09-19 Tom Tromey <tom@tromey.com> + * osabi.h (generic_elf_osabi_sniff_abi_tag_sections): Update. * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Change parameters. diff --git a/gdb/gcore.c b/gdb/gcore.c index d0e36b1..46ca2da 100644 --- a/gdb/gcore.c +++ b/gdb/gcore.c @@ -364,7 +364,7 @@ derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top) } static void -make_output_phdrs (bfd *obfd, asection *osec, void *ignored) +make_output_phdrs (bfd *obfd, asection *osec) { int p_flags = 0; int p_type = 0; @@ -531,7 +531,7 @@ objfile_find_memory_regions (struct target_ops *self, } static void -gcore_copy_callback (bfd *obfd, asection *osec, void *ignored) +gcore_copy_callback (bfd *obfd, asection *osec) { bfd_size_type size, total_size = bfd_section_size (osec); file_ptr offset = 0; @@ -587,10 +587,12 @@ gcore_memory_sections (bfd *obfd) } /* Record phdrs for section-to-segment mapping. */ - bfd_map_over_sections (obfd, make_output_phdrs, NULL); + for (asection *sect : gdb_bfd_sections (obfd)) + make_output_phdrs (obfd, sect); /* Copy memory region contents. */ - bfd_map_over_sections (obfd, gcore_copy_callback, NULL); + for (asection *sect : gdb_bfd_sections (obfd)) + gcore_copy_callback (obfd, sect); return 1; } |