public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb, thread-iter: handle null_ptid
@ 2021-11-19  7:23 Markus Metzger
  2021-11-19 13:56 ` Simon Marchi
  0 siblings, 1 reply; 9+ messages in thread
From: Markus Metzger @ 2021-11-19  7:23 UTC (permalink / raw)
  To: gdb-patches

Fix a regression introduced by

    0618ae41497 gdb: optimize all_matching_threads_iterator

and exposed by

    FAIL: gdb.btrace/enable-new-thread.exp: ... (GDB internal error)

When we learn about a new thread in a new inferior, we add both and notify
GDB about them, but we do not set inferior_ptid.

On the notification, record-btrace tries to enable recording of the new
thread and, while reading the configuration, checks whether inferior_ptid
is replaying.

This causes the new all_matching_threads_iterator to think we want to
iterate over a single thread, while in reality we do not really want to
iterate over any thread.

Handle that case.
---
 gdb/thread-iter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/thread-iter.c b/gdb/thread-iter.c
index e56ccd857b0..a2018fd7c10 100644
--- a/gdb/thread-iter.c
+++ b/gdb/thread-iter.c
@@ -117,7 +117,7 @@ all_matching_threads_iterator::all_matching_threads_iterator
 	  if (m_inf != nullptr)
 	    m_thr = &m_inf->thread_list.front ();
 	}
-      else
+      else if (filter_ptid != null_ptid)
 	{
 	  /* Iterate on a single thread.  */
 	  m_mode = mode::SINGLE_THREAD;
-- 
2.31.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-11-25 14:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19  7:23 [PATCH] gdb, thread-iter: handle null_ptid Markus Metzger
2021-11-19 13:56 ` Simon Marchi
2021-11-22  5:59   ` Metzger, Markus T
2021-11-22 16:07     ` Simon Marchi
2021-11-23 14:09       ` Metzger, Markus T
2021-11-23 17:22         ` Simon Marchi
2021-11-24  7:12           ` Metzger, Markus T
2021-11-24 20:54             ` Simon Marchi
2021-11-25 14:57               ` Metzger, Markus T

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).