From: Simon Marchi <simark@simark.ca>
To: Christian Biesinger <cbiesinger@google.com>,
Simon Marchi <simon.marchi@efficios.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb: reset/recompute objfile section offsets in reread_symbols
Date: Wed, 20 May 2020 15:34:18 -0400 [thread overview]
Message-ID: <37e9ae9c-ff16-f571-596a-2f6b153d29c4@simark.ca> (raw)
In-Reply-To: <CAPTJ0XEur76p4C6og4FomWTWubY4jwLaBwteN-U8dtG6vWHhxA@mail.gmail.com>
On 2020-05-20 3:24 p.m., Christian Biesinger via Gdb-patches wrote:
> 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
>
Probably not ideal, but probably better than what we have now. At least
the knowledge of how to reset an objfile to an original state would be in
the objfile class itself.
I think it would be nicer to just free the objfile and create a new one from
scratch, although I don't know what other problems come with that.
Simon
next prev parent reply other threads:[~2020-05-20 19:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 19:22 Simon Marchi
2020-05-20 19:24 ` Christian Biesinger
2020-05-20 19:34 ` Simon Marchi [this message]
2020-05-20 19:36 ` Tom Tromey
2020-05-20 19:43 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=37e9ae9c-ff16-f571-596a-2f6b153d29c4@simark.ca \
--to=simark@simark.ca \
--cc=cbiesinger@google.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox