Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Aktemur, Tankut Baris" <tankut.baris.aktemur@intel.com>
To: Simon Marchi <simark@simark.ca>,
	Andrew Burgess <aburgess@redhat.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH 1/2] gdb, multi-target: pass a target argument to prune_threads
Date: Mon, 20 Apr 2026 07:46:39 +0000	[thread overview]
Message-ID: <DM4PR11MB7303233C9C09DAE6287BD61CC42F2@DM4PR11MB7303.namprd11.prod.outlook.com> (raw)
In-Reply-To: <8dfccb11-f39e-4a65-9ca3-ac924597140d@simark.ca>

Hi Andrew,

On Friday, April 17, 2026 5:35 PM, Simon Marchi wrote:
> On 4/17/26 11:16 AM, Andrew Burgess wrote:
> > Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> writes:
> >
> >> From the way 'prune_threads' is used, it is designed to delete the
> >> threads of the current target.  So, while iterating the threads,
> >> ignore those that do not belong to the current target.
> >
> > I'm not saying that you're wrong, but could you expand on this, maybe
> > giving some examples of how it's used and why that suggests it should be
> > a per- target operation.
> >
> > Did the current code cause some problems?  Is there scope for adding a
> > test maybe?
> >
> > FWIW: I think this change is probably OK, but the commit message seems a
> > little light on detail for my taste.
> >
> > Thanks,
> > Andrew
> 
> I'm not against having more details, but the fact that prune_threads is
> called from the various targets' update_thread_list methods (or similar)
> is a good clue.  In a multi-target scenario, as the  target updates the
> threads it is responsible for, it should not start messing with threads
> of other targets.

What Simon wrote here is the motivation of the patch.  I tried to
state this in the commit message, but I admit it wasn't so clear.

The concrete problem that led to the patch is the following:
Intel's downstream debugger uses two targets (native and remote)
in non-stop and all-stop mode.  (This combination is not supported
in upstream GDB but there are additional patches in Intel's branch
to enable non-stop + all-stop configuration.)
When there is a stop event coming from the native target, GDB enters
stop_all_threads, where it attempts to update the thread list of each
target.  However, the other target (i.e. remote) is in all-stop mode
and it cannot respond to the thread_alive request made in prune_threads,
leading to an error.

Regards,
-Baris


Intel Deutschland GmbH
Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

      reply	other threads:[~2026-04-20  7:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-17 11:14 Tankut Baris Aktemur
2026-04-17 15:16 ` Andrew Burgess
2026-04-17 15:35   ` Simon Marchi
2026-04-20  7:46     ` Aktemur, Tankut Baris [this message]

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=DM4PR11MB7303233C9C09DAE6287BD61CC42F2@DM4PR11MB7303.namprd11.prod.outlook.com \
    --to=tankut.baris.aktemur@intel.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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