public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 3/3] Per-inferior thread list, thread ranges/iterators, down with ALL_THREADS, etc.
Date: Mon, 01 Oct 2018 16:33:00 -0000	[thread overview]
Message-ID: <bd5968b0-ada1-ae41-41eb-6ec9f0291288@FreeBSD.org> (raw)
In-Reply-To: <20181001103252.5150-4-palves@redhat.com>

On 10/1/18 3:32 AM, Pedro Alves wrote:
> As preparation for multi-target, this patch makes each inferior have
> its own thread list.

The BSD-related bits all look fine to me.  Do you have an existing branch
for this on github that I can pull down to do some simple run-time testing?

> As for the init_thread_list calls sprinkled around, they're all
> eliminated by this patch, and a new, central call is added to
> inferior_appeared.  Note how also related to that, there's a call to
> init_wait_for_inferior in remote.c that is eliminated.
> init_wait_for_inferior is currently responsible for discarding skipped
> inline frames, which had to be moved elsewhere.  Given that nowadays
> we always have a thread even for single-threaded processes, the
> natural place is to delete a frame's inline frame info when we delete
> the thread.  I.e., from clear_thread_inferior_resources.

This brings up another question I have.  I have out-of-tree patches to add
FreeBSD kernel-awareness (there's a mixture of authors and many of the
kernel-specific bits are BSD licensed, so I can't upstream it as is, though
at some point I might be able to upstream portions of it).  One of the changes
in this branch is that I have a kernel target similar to bsd-kvm.c but with
awareness of threads (so it creates a GDB thread for each kernel thread in
the kernel image being examined).  Right now this uses init_thread_list
(ugh).  What is the right thing to do?  Should it instead be creating a
new inferior to represent the kernel and its set of threads?

A somewhat related question is one thing I haven't yet solved which is
how to "stack" kernel threads on top of a remote target that presents each
CPU as a thread to GDB (e.g. the GDB stub in qemu, or the one I'm working on
in FreeBSD's hypervisor).  I still don't quite know how to think about
solving that, but that is a bit more of an ambitious change I suspect.

-- 
John Baldwin

                                                                            

  reply	other threads:[~2018-10-01 16:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 10:32 [PATCH 0/3] Per-inferior thread list, multi-target prep Pedro Alves
2018-10-01 10:32 ` [PATCH 1/3] Avoid find_thread_ptid with null_ptid Pedro Alves
2018-10-01 15:54   ` Tom Tromey
2018-10-02 17:08     ` Pedro Alves
2018-10-02 21:14       ` Tom Tromey
2018-10-01 10:33 ` [PATCH 2/3] Fix follow_exec latent problem Pedro Alves
2018-10-01 10:33 ` [PATCH 3/3] Per-inferior thread list, thread ranges/iterators, down with ALL_THREADS, etc Pedro Alves
2018-10-01 16:33   ` John Baldwin [this message]
2018-10-02 13:21     ` Pedro Alves
2018-10-03 17:34       ` John Baldwin
2018-10-04 19:16         ` Pedro Alves
2018-10-01 17:12   ` Tom Tromey
2018-10-03 12:12     ` Pedro Alves
2018-11-22 16:28 ` [PATCH 0/3] Per-inferior thread list, multi-target prep Pedro Alves

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=bd5968b0-ada1-ae41-41eb-6ec9f0291288@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).