From patchwork Mon Oct 30 16:11:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 56296 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1E9C13861818 for ; Mon, 30 Oct 2023 16:11:37 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 57EE73857020 for ; Mon, 30 Oct 2023 16:11:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 57EE73857020 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 57EE73857020 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698682281; cv=none; b=MXHs+56+3YjYhnrpSJQTqKqDnvOqRHXQ0nmGhkvhcOAXYfmsdH5XajngWka/yIVdAHI5yPjG5Z6QHjO8e5vyZQSidPHxfAXbVrmn1oGUkkSBNxRwawlcNvwXvAOoIaIu86T/Fo4JfkpnYv/IesKs9o5bIiesLf0ypg3N6zgimxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698682281; c=relaxed/simple; bh=o613MgPpmtsCaTVSLcz611cx9l7MTjtCTV1hK+SoSeA=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=FdLOOXg9MNEkyyK84EmCuOKL0+mMFucYSI8y3k8P5oVqUROx6L0il7Tsfc2hazl0pcLUzV9DjDutreqIYVPuahBKByqUfSZxV8TYoDoODa/20vJjpfNoZUFbeVSxc2zRjUPOJEoR7Cm5dRrDPfwXaZ2Byphn+d0pFF1DHNCNw8A= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698682280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1i67WddZEfPyxCMSeGzi0lqLlufsaWCpy8WtxXTSQtI=; b=OlK5pjLzn7Gw0lwNqBy70Js68rK7s6hOvxmJ3dunhuw0CN4cYX20TcI2IpXVoVJE2DUD8M rr0cYe3rM4CFQC0SwUAJ8Q38OWwYcdjZYjFAl8mwxiJ/9gSRrDXrH09EHbCtzeBo6Mwue4 2WZdgmmW0Ha9UwG+bb8pXVIXpf/lCjM= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-172-G_CxZ7q7MdG8CWWXNh-JyQ-1; Mon, 30 Oct 2023 12:11:18 -0400 X-MC-Unique: G_CxZ7q7MdG8CWWXNh-JyQ-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-9ba247e03aeso311844966b.1 for ; Mon, 30 Oct 2023 09:11:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698682277; x=1699287077; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1i67WddZEfPyxCMSeGzi0lqLlufsaWCpy8WtxXTSQtI=; b=DVYD6L8udoafE8ssybYBocomH8qcU3DXOE61xODNQhUyLTl324W6jGp/s2p5jNnfiQ LnEy1g4IGVUqznGv5+2QkIi1L4pOeO7DebaQhYSLQ1joj3rKwSUn7+altxLFe2a1XJ+D QGat8LJGgJLKhYM7+Qe91KVUnRkytItIwidd9UlJVETLJD5jjOJmJCNNmFslgMtIYH/R Wm6dfMmAI4rvA1prv/be6Xj/TwzPo1ZKhI57FwK8XHBsp26BGLlQcB+qIvhHB+aayzqO BmQ5HfVkkYYSQFVw6qWkOzC/JwqoHl8BkPFsjearK7qTnUodobGtf2Az/1rMo/rfJ1GB BmVg== X-Gm-Message-State: AOJu0YxsxNXYjePDefuYB/2BynhNIM0J6OaOkSAoM5Txzcfdc9T3LTlw fuvX4zQHPMk5w1wD9QZ86jhQdZGKDH5QTfy7O6zfK5fyy3URaeHxqWH5C0DSjZVZMbHpqegeosk 8lzJYAf3z3T6YhKneNawvLhMvBMwDi9Q+ZI/+7kzKKqE/TECDnzVwEiPnANmmdJIfLwpmdDkVeC oixUhp3g== X-Received: by 2002:a17:907:ea7:b0:9c6:4224:67d2 with SMTP id ho39-20020a1709070ea700b009c6422467d2mr10172872ejc.50.1698682277457; Mon, 30 Oct 2023 09:11:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnp6sSPATQaVLLCcMVsHRaoAyPFkjDpAd+qmBPertNaKJKdByKH61xUAvsD1nHMEDFa/vL0w== X-Received: by 2002:a17:907:ea7:b0:9c6:4224:67d2 with SMTP id ho39-20020a1709070ea700b009c6422467d2mr10172853ejc.50.1698682277136; Mon, 30 Oct 2023 09:11:17 -0700 (PDT) Received: from localhost ([31.111.84.209]) by smtp.gmail.com with ESMTPSA id jt21-20020a170906dfd500b0099bd1ce18fesm6286528ejc.10.2023.10.30.09.11.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 09:11:16 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv6 00/10] thread-specific breakpoints in just some inferiors Date: Mon, 30 Oct 2023 16:11:04 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org In v6: - Rebased to something closer to current HEAD, one minor issue that needed resolving after the rebase. - Hopefully patch #10 will be sent correctly this time. I managed to not send patch 10/10 with the v5 series. In v5: - Updates after Lancelot's feedback, including, -force-condition can no longer be abbreviated to '-', and can't be used immediately after the breakpoint condition. - More tests to check some of the edge cases. In v4: - Big update, this series now handles thread-specific and inferior-specific breakpoints. In v3: - Rebased on to current upstream/master, this includes all Simon's recent breakpoint changes. Retested with no regressions seen. In v2: - Rebased on current upstream/master and retested, - No changes to code or docs. --- Andrew Burgess (10): gdb: create_breakpoint: add asserts and additional comments gdb: create_breakpoint: asserts relating to extra_string/parse_extra gdb: change 'if' to gdb_assert in update_dprintf_command_list gdb: build dprintf commands just once in code_breakpoint constructor gdb: don't display inferior list for pending breakpoints gdb: parse pending breakpoint thread/task immediately gdb: don't set breakpoint::pspace for in create_breakpoint gdb: remove breakpoint_re_set_one gdb: remove tracepoint_probe_create_sals_from_location_spec gdb: only insert thread-specific breakpoints in the relevant inferior gdb/Makefile.in | 2 + gdb/NEWS | 11 + gdb/ada-lang.c | 6 +- gdb/break-catch-throw.c | 6 +- gdb/break-cond-parse.c | 463 +++++++++++ gdb/break-cond-parse.h | 49 ++ gdb/breakpoint.c | 757 +++++++++--------- gdb/breakpoint.h | 101 ++- gdb/testsuite/gdb.ada/tasks.exp | 6 +- gdb/testsuite/gdb.base/condbreak.exp | 57 +- gdb/testsuite/gdb.base/pending.exp | 23 +- gdb/testsuite/gdb.linespec/explicit.exp | 4 +- gdb/testsuite/gdb.mi/mi-dprintf-pending.exp | 3 +- gdb/testsuite/gdb.mi/new-ui-bp-deleted.exp | 8 +- .../gdb.mi/user-selected-context-sync.exp | 4 +- .../gdb.multi/bp-thread-specific.exp | 7 +- .../gdb.multi/inferior-specific-bp.exp | 16 +- .../gdb.multi/multi-target-continue.exp | 2 +- .../gdb.multi/multi-target-ping-pong-next.exp | 4 +- .../gdb.multi/pending-bp-del-inferior.c | 28 + .../gdb.multi/pending-bp-del-inferior.exp | 214 +++++ gdb/testsuite/gdb.multi/pending-bp-lib.c | 22 + gdb/testsuite/gdb.multi/pending-bp.c | 66 ++ gdb/testsuite/gdb.multi/pending-bp.exp | 336 ++++++++ gdb/testsuite/gdb.multi/tids.exp | 6 +- .../gdb.threads/del-pending-thread-bp-lib.c | 22 + .../gdb.threads/del-pending-thread-bp.c | 85 ++ .../gdb.threads/del-pending-thread-bp.exp | 108 +++ 28 files changed, 1947 insertions(+), 469 deletions(-) create mode 100644 gdb/break-cond-parse.c create mode 100644 gdb/break-cond-parse.h create mode 100644 gdb/testsuite/gdb.multi/pending-bp-del-inferior.c create mode 100644 gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp create mode 100644 gdb/testsuite/gdb.multi/pending-bp-lib.c create mode 100644 gdb/testsuite/gdb.multi/pending-bp.c create mode 100644 gdb/testsuite/gdb.multi/pending-bp.exp create mode 100644 gdb/testsuite/gdb.threads/del-pending-thread-bp-lib.c create mode 100644 gdb/testsuite/gdb.threads/del-pending-thread-bp.c create mode 100644 gdb/testsuite/gdb.threads/del-pending-thread-bp.exp base-commit: 2029e13917d53d2289d3ebb390c4f40bd2112d21