From: Kevin Buettner <kevinb@redhat.com>
To: Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org>
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: Re: [PATCH 1/3] gdb: split inferior and thread setup when opening a core file
Date: Fri, 9 Jun 2023 17:04:45 -0700 [thread overview]
Message-ID: <20230609170445.021dbed2@f38-zws-nv> (raw)
In-Reply-To: <a99db75d461e1d414b49f7c781096658bfb73680.1685956034.git.aburgess@redhat.com>
On Mon, 5 Jun 2023 10:11:07 +0100
Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> wrote:
> I noticed that in corelow.c, when a core file is opened, both the
> thread and inferior setup is done in add_to_thread_list. In this
> patch I propose hoisting the inferior setup out of add_to_thread_list
> into core_target_open.
>
> The only thing about this change that gave me cause for concern is
> that in add_to_thread_list, we only setup the inferior after finding
> the first section with a name like ".reg/NN". If we find no such
> section then the inferior will never be setup.
>
> Is this important?
>
> Well, I don't think so. Back in core_target_open, if there is no
> current thread (which there will not be if no ".reg/NN" section was
> found), then we look for a thread in the current inferior. If there
> are no threads (which there will not be if no ".reg/NN" is found),
> then we once again setup the current inferior.
>
> What I think this means, is that, in all cases, the current inferior
> will end up being setup. By moving the inferior setup code earlier in
> core_target_open and making it non-conditional, we can remove the
> later code that sets up the inferior, we now know this will always
> have been done.
>
> There should be no user visible changes after this commit.
> ---
> gdb/corelow.c | 62 ++++++++++++++++++++++++---------------------------
> 1 file changed, 29 insertions(+), 33 deletions(-)
LGTM.
Reviewed-by: Kevin Buettner <kevinb@redhat.com>
next prev parent reply other threads:[~2023-06-10 0:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-05 9:11 [PATCH 0/3] Improve vmcore loading Andrew Burgess
2023-06-05 9:11 ` [PATCH 1/3] gdb: split inferior and thread setup when opening a core file Andrew Burgess
2023-06-10 0:04 ` Kevin Buettner [this message]
2023-06-05 9:11 ` [PATCH 2/3] gdb/testsuite: add test for core file with a 0 pid Andrew Burgess
2023-06-10 0:16 ` Kevin Buettner
2023-07-06 14:49 ` Pedro Alves
2023-07-07 9:56 ` Andrew Burgess
2023-07-10 11:10 ` Andrew Burgess
2023-06-05 9:11 ` [PATCH 3/3] gdb: handle core files with .reg/0 section names Andrew Burgess
2023-06-10 0:36 ` Kevin Buettner
2023-07-03 17:03 ` [PATCH 0/3] Improve vmcore loading Andrew Burgess
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=20230609170445.021dbed2@f38-zws-nv \
--to=kevinb@redhat.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).