From patchwork Wed Dec 13 22:38:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 56506 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 3B967385E00D for ; Wed, 13 Dec 2023 22:39:00 +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.129.124]) by sourceware.org (Postfix) with ESMTPS id 496523858D20 for ; Wed, 13 Dec 2023 22:38:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 496523858D20 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 496523858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702507123; cv=none; b=pRyB0Hw18ajMYsVOidSlKe0574sCWFjfHmsRy9VL7LGx9mSt2gJcq1Bt6yaSs4dhK3AmZPsx0+2WDn5SBQPr1jBASiCYcXBUZ2wjwH1MPOyKBVdUhBaGnn+g9wE4FaowxSQRap/ryKTuATKiixHJvuX/gzEQRNTKY2XcZ/we6nY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702507123; c=relaxed/simple; bh=ZJl92t8FLF74f3PYGERQmQ2AfszzTk5+CHtne5BNcpg=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=iQZJwCr1EAk5hYraIjfLgaBv5fUS0QoNt5qS2tSDkpsSNGUWdcYNlw7PVHYJq5sjv40yBqtV9XBkdiDtU3pwUVP3bYLz5jCObLbelobfvLo7iaLxGtUZkDTbR/Fm1sLyVkXLVJkxwwgv4wn6bRG0FrLEJ1GDW7irvBljeh5em2k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702507121; 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=vXs8X/KyQ1Q7Hd4/zZaa0feL1+V6mVD4xKGQR2kWTWY=; b=SuXSHZjaXXGuVcnUMcOoP2w6kv+i26FogWmMjH3ZDp9H0f0eAto4UWFXRUWDGtEggldX88 Oed452pc9EUrrenPkNOK5QUYbsEj7S93zQoB/z7AqVHFLsu5NZPbW3HBxhsu4nm3JiLXRV k2ZRtUGlW6/qXc/sK+dnwGpROgX2Zlg= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-371-nnBSrWVoPnmcBkr3OYdMug-1; Wed, 13 Dec 2023 17:38:40 -0500 X-MC-Unique: nnBSrWVoPnmcBkr3OYdMug-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-40c42205ed0so30630335e9.2 for ; Wed, 13 Dec 2023 14:38:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507118; x=1703111918; 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=vXs8X/KyQ1Q7Hd4/zZaa0feL1+V6mVD4xKGQR2kWTWY=; b=HCVycZmeK3OE7+01w2H76+SPDPCP1Tw0fTiBgJDxGq1NgToefcrr/S0CzW90VUf8jg nNth22/24pXrp1kbzsqRW4a52e5KW3GYdeMDpqRJM+Z2be3SJjdgxMe3WfMlfDoSi17+ vdHVpc2SZZjBO4xKzYQD1lKHS+4qPDV0x0frlxjiMcLDeZjL8zA5xOTX43PqQxugzs05 9AvL+smS2x2IsizUvWpU24lvsMqyXY7M4WfBKv4+0FNVCrisBEnLgz0deT6c5B5pLNWY 2NqNJFQUqC2VlHUxhAt9GCM9S+hzxPrhRfP5ocxehhNy1nEPqgixKF03BCC2rB10lIWf QOgA== X-Gm-Message-State: AOJu0YwpCdF3o5HLcXlxxuoL4d7urLjoFQRk68D3iA7RdDQCwtpdQEVm Kd4eK/EgE76VMimrhDutl2y5IMqZJU+mHhOr0c25IjU4JVxFcYlMIGbxxII/OpT+3/AAQei99qR h6UOpWRQwaJK2M3og/40N0THImnKlmf4KOXwZI/FAhbjkk+Prg4grIk4jpeTPNPjw6eEY+7BI1z g7onZF0A== X-Received: by 2002:a05:600c:444e:b0:40c:48c2:f69f with SMTP id v14-20020a05600c444e00b0040c48c2f69fmr2628733wmn.12.1702507118138; Wed, 13 Dec 2023 14:38:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEKGKEi7egc67RgT2quZ66I4IzLPTFd3O/qXv7FEymYpUwyc73U6CAIzwoDJHgRVi5jVrtfw== X-Received: by 2002:a05:600c:444e:b0:40c:48c2:f69f with SMTP id v14-20020a05600c444e00b0040c48c2f69fmr2628726wmn.12.1702507117789; Wed, 13 Dec 2023 14:38:37 -0800 (PST) Received: from localhost (105.226.159.143.dyn.plus.net. [143.159.226.105]) by smtp.gmail.com with ESMTPSA id s10-20020a05600c45ca00b0040c3dcc36e6sm17637748wmo.47.2023.12.13.14.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:38:37 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv7 00/11] thread-specific breakpoints in just some inferiors Date: Wed, 13 Dec 2023 22:38:24 +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.7 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_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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 v7: - Addressed all the issues except one that Baris pointed out, this includes typos, some minor testsuite cleanups, and reformatting an assert (but not changing the meaning). - As requested, switched to use std::string_view in break-parse-cond.c file instead of a custom class, I agree that this is an improvement. - I've not changed the handling of -force-condition flag. I replied to the review email with my thoughts, TLDR: fixing this would be a bigger task which I'd rather leave for ... the future. - Rebased and retested. In v6: - Rebased to current master, one minor fix due to the C++17 changes, nothing major. Retested. 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 (11): 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: the extra_string in a dprintf breakpoint is never nullptr 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 | 425 ++++++++++ gdb/break-cond-parse.h | 49 ++ gdb/breakpoint.c | 764 ++++++++---------- 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 | 332 ++++++++ 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, 1906 insertions(+), 475 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: 5c5e642dc0f6b223c2339d8dee64fbc63eee8e1a