From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96501 invoked by alias); 1 Oct 2018 10:32:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 96469 invoked by uid 89); 1 Oct 2018 10:32:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 01 Oct 2018 10:32:55 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39636308A964 for ; Mon, 1 Oct 2018 10:32:54 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9C6960BB4 for ; Mon, 1 Oct 2018 10:32:53 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 0/3] Per-inferior thread list, multi-target prep Date: Mon, 01 Oct 2018 10:32:00 -0000 Message-Id: <20181001103252.5150-1-palves@redhat.com> X-SW-Source: 2018-10/txt/msg00010.txt.bz2 Here's another chunk split out from my multi-target branch (on github). (It's the chunk that I mentioned would be next at the Cauldron's multi-core BoF.) Patch #3 is the real deal. See its commit log for the full description, but the gist is that it makes each inferior have its own thread list, and replaces the ALL_THREADS / ALL_NON_EXITED_THREADS / ALL_INFERIORS macros with (C++20-like) ranges and iterators, such that you can instead naturaly iterate over threads/inferiors using range-for, like e.g,.: // all threads, including THREAD_EXITED threads. for (thread_info *tp : all_threads ()) { .... } // all non-exited threads. for (thread_info *tp : all_non_exited_threads ()) { .... } // all non-exited threads of INF inferior. for (thread_info *tp : inf->non_exited_threads ()) { .... } Patches #1 and #2 fix latent problems exposed by patch #3. Pedro Alves (3): Avoid find_thread_ptid with null_ptid Fix follow_exec latent problem Per-inferior thread list, thread ranges/iterators, down with ALL_THREADS, etc. gdb/Makefile.in | 1 + gdb/breakpoint.c | 7 +- gdb/btrace.c | 4 +- gdb/cli/cli-interp.c | 4 +- gdb/common/filtered-iterator.h | 87 +++++++++++ gdb/common/safe-iterator.h | 93 +++++++++++ gdb/corelow.c | 6 - gdb/darwin-nat.c | 10 +- gdb/fbsd-nat.c | 21 +-- gdb/fbsd-tdep.c | 6 +- gdb/fork-child.c | 7 +- gdb/gdbarch-selftests.c | 2 +- gdb/gdbthread.h | 91 +++++++---- gdb/infcmd.c | 69 +++----- gdb/inferior-iter.h | 117 ++++++++++++++ gdb/inferior.c | 136 ++++++---------- gdb/inferior.h | 83 +++++++--- gdb/inflow.c | 6 +- gdb/infrun.c | 187 +++++++++------------- gdb/linux-nat.c | 43 +++-- gdb/linux-tdep.c | 6 +- gdb/linux-thread-db.c | 8 +- gdb/mi/mi-interp.c | 60 +++---- gdb/mi/mi-main.c | 5 +- gdb/nto-procfs.c | 2 - gdb/python/py-inferior.c | 4 +- gdb/record-btrace.c | 72 +++------ gdb/record-full.c | 4 +- gdb/regcache.c | 3 - gdb/remote-sim.c | 3 - gdb/remote.c | 75 +++------ gdb/target.c | 8 +- gdb/thread-iter.c | 101 ++++++++++++ gdb/thread-iter.h | 311 ++++++++++++++++++++++++++++++++++++ gdb/thread.c | 346 ++++++++++++----------------------------- gdb/tid-parse.c | 12 +- gdb/tui/tui-interp.c | 4 +- gdb/x86-bsd-nat.c | 14 +- 38 files changed, 1211 insertions(+), 807 deletions(-) create mode 100644 gdb/common/filtered-iterator.h create mode 100644 gdb/common/safe-iterator.h create mode 100644 gdb/inferior-iter.h create mode 100644 gdb/thread-iter.c create mode 100644 gdb/thread-iter.h -- 2.14.4