[PATCH] gdb: reset/recompute objfile section offsets in reread_symbols

Christian Biesinger cbiesinger@google.com
Wed May 20 19:24:16 GMT 2020


On Wed, May 20, 2020 at 2:22 PM Simon Marchi via Gdb-patches
<gdb-patches@sourceware.org> wrote:
> diff --git a/gdb/symfile.c b/gdb/symfile.c
> index dd8192a67fbb..b02a9235663b 100644
> --- a/gdb/symfile.c
> +++ b/gdb/symfile.c
> @@ -2543,6 +2543,11 @@ reread_symbols (void)
>              will need to be called (see discussion below).  */
>           obstack_free (&objfile->objfile_obstack, 0);
>           objfile->sections = NULL;
> +         objfile->section_offsets.clear ();
> +         objfile->sect_index_bss = -1;
> +         objfile->sect_index_data = -1;
> +         objfile->sect_index_rodata = -1;
> +         objfile->sect_index_text = -1;

Would it make sense to have a reset() function on objfile instead,
that handles all necesary clearing of members?

Christian


More information about the Gdb-patches mailing list