mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-04 22:15:12 +08:00
Use gdb_bfd_sections in gdb_bfd_close_or_warn
This changes gdb_bfd_close_or_warn to avoid bfd_map_over_sections, in favor of iteration. gdb/ChangeLog 2020-09-19 Tom Tromey <tom@tromey.com> * gdb_bfd.c (free_one_bfd_section): Remove 'abfd' and 'ignore' parameters. (gdb_bfd_close_or_warn): Use foreach.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2020-09-19 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* gdb_bfd.c (free_one_bfd_section): Remove 'abfd' and 'ignore'
|
||||||
|
parameters.
|
||||||
|
(gdb_bfd_close_or_warn): Use foreach.
|
||||||
|
|
||||||
2020-09-19 Tom Tromey <tom@tromey.com>
|
2020-09-19 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* corelow.c (add_to_thread_list): Change parameters.
|
* corelow.c (add_to_thread_list): Change parameters.
|
||||||
|
@ -507,7 +507,7 @@ gdb_bfd_open (const char *name, const char *target, int fd,
|
|||||||
BFD. */
|
BFD. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore)
|
free_one_bfd_section (asection *sectp)
|
||||||
{
|
{
|
||||||
struct gdb_bfd_section_data *sect
|
struct gdb_bfd_section_data *sect
|
||||||
= (struct gdb_bfd_section_data *) bfd_section_userdata (sectp);
|
= (struct gdb_bfd_section_data *) bfd_section_userdata (sectp);
|
||||||
@ -536,7 +536,8 @@ gdb_bfd_close_or_warn (struct bfd *abfd)
|
|||||||
int ret;
|
int ret;
|
||||||
const char *name = bfd_get_filename (abfd);
|
const char *name = bfd_get_filename (abfd);
|
||||||
|
|
||||||
bfd_map_over_sections (abfd, free_one_bfd_section, NULL);
|
for (asection *sect : gdb_bfd_sections (abfd))
|
||||||
|
free_one_bfd_section (sect);
|
||||||
|
|
||||||
ret = bfd_close (abfd);
|
ret = bfd_close (abfd);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user