Message ID | cover.1721494871.git.aburgess@redhat.com |
---|---|
Headers |
Return-Path: <gdb-patches-bounces~patchwork=sourceware.org@sourceware.org> 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 981FD3860C3E for <patchwork@sourceware.org>; Sat, 20 Jul 2024 17:04: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.133.124]) by sourceware.org (Postfix) with ESMTPS id 5AE0D3858C41 for <gdb-patches@sourceware.org>; Sat, 20 Jul 2024 17:03:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5AE0D3858C41 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 5AE0D3858C41 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=1721495008; cv=none; b=YVKiIkXLZvnmxhnvOJs0ntMp1gq0DFK/dD3kGdqIGxutFNJVEhK5AviALtOl3P9ivVW37AWKjr2TAs+po/byvfnA0LLDdpMiXvo51LLMuiee+6XeakdsRUoogDMMa3lIqGiuypY+UtNM8qOYG0N9kKQDpjFki6DqIZeTq1QbE3k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721495008; c=relaxed/simple; bh=GGCiXAIOd31T1HOBETBBakzTs7BLa/AzQjYVIOH8hWY=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=CnWEdKNtVuoftEKJ84DS+jQ8238ivXBV9v49HmuDfGnNW61+X3O9zXQGABGwJJHutaWJz4xK7MElBThRrcxii01Kn45TCTQE48nUMEe4SVP8NgfUIvrH3gt8hWuRMEuQVb/KhBNIZe1WmLHyTTJDbdIqt+fWDxg3OqLgxtgYn18= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721495006; 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=UlFp7lID+smzJtJmdPF4bCfsMh1Vnak+03wMhfhuGHA=; b=QHag+MGqjwhI+3a1Am/VETuDyIt+texZXCUPROgbVdK/SIbRGNlJJLuYobfuzT2g7FJ047 KeArePNDYDf/XQJPsoWcVcSwtbFf/nMu3bJVyIp7NrKI780+G+O0sFegrcAbko50b2GHpJ KMeWM88hs4gdbfGUFobbKddQM0y+k7Y= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-418-p5l43tC3PGOyI4ggUxHbyA-1; Sat, 20 Jul 2024 13:03:24 -0400 X-MC-Unique: p5l43tC3PGOyI4ggUxHbyA-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4279b07cd45so18351425e9.3 for <gdb-patches@sourceware.org>; Sat, 20 Jul 2024 10:03:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721495002; x=1722099802; 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=UlFp7lID+smzJtJmdPF4bCfsMh1Vnak+03wMhfhuGHA=; b=k1dhSB8ueKC8UaOLp1/QtyHMSBwn9HQTs4sFVldmX7QKz/XhibJHhKuFiLebUlVpR+ INk+fVpe2AKOpJYPnbzuDAkhyHcs7HNh1QljQnykFGgyvDpV1tzGAHKr54PjWt+R982x JX3REO2bsPwcmWL/+f9qyEuRgsv4+WQauSJ0BfEm/yfRnuhcL2WOcQDTN/m+vFvxLCE+ 4UFgBhpIo1LxxSrFVlO+KU2c6TfozuQe4bCLWN+IZJ4PWMGB8dTI2QGBttGVGEducPF2 DgbngOxvybXBMq047Ybj9/1LjZBIxUAgQcEQMgwV5ZLusbytVn3Vj2leJdJwCEXmGYRC hEWA== X-Gm-Message-State: AOJu0YzfVF9+F3WTKHbFa7Vf6tqqYs8y7FMBTS+nIMxLmrEb1Yro6e+M zOPgvi7bPgOVzJvzoK6rB4cK4SGEAyuj5CNu4TxwsRsJK7mOBSVNHUzpZHAl0Ktjos6+9vip7cU IoqiQOR39VBzzgNsSQfy2jLAramAd88ko7uzlvO4fCInzSjPj+3lgq4Az36hlUiKe/SS21reg4B VJFTHijE2aMRdH6Dj6Qa+8+fNPl0b+gCHTEnZWgMBP2/g= X-Received: by 2002:a05:600c:35d4:b0:426:5b3a:96c with SMTP id 5b1f17b1804b1-427df79d8cfmr3502065e9.28.1721495002423; Sat, 20 Jul 2024 10:03:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHk/u2JDltYmyYL3dGF7HmwTjVEmpBJfzsz0mhtPNU8PCTQBl9cdz2uDO5k2qSs0+XhbZHwvA== X-Received: by 2002:a05:600c:35d4:b0:426:5b3a:96c with SMTP id 5b1f17b1804b1-427df79d8cfmr3501845e9.28.1721495001809; Sat, 20 Jul 2024 10:03:21 -0700 (PDT) Received: from localhost ([31.111.84.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427d2a6e91fsm89075205e9.23.2024.07.20.10.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jul 2024 10:03:21 -0700 (PDT) From: Andrew Burgess <aburgess@redhat.com> To: gdb-patches@sourceware.org Cc: Andrew Burgess <aburgess@redhat.com> Subject: [PATCHv12 0/6] thread-specific breakpoints in just some inferiors Date: Sat, 20 Jul 2024 18:03:13 +0100 Message-Id: <cover.1721494871.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <cover.1717594119.git.aburgess@redhat.com> References: <cover.1717594119.git.aburgess@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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, TVD_PH_BODY_ACCOUNTS_PRE, 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
Series |
thread-specific breakpoints in just some inferiors
|
|
Message
Andrew Burgess
July 20, 2024, 5:03 p.m. UTC
I've gone ahead and pushed the first 3 patches from the v11 series. The remaining patches have been rebased and retested. --- In v12: - First 3 patches from previous version have now been merged, - Rebased to current master and retested. Few minor testsuite changes to account for other changes in the master branch, nothing major though. In v11: - Rebased on to current upstream master. No significant merge issues found. Retested, no issues found. In v10: - I merged the first 5 patches. These were mostly just adding extra asserts, or minor refactoring and cleanup that didn't change GDB's behaviour. Patch #2 did have a minor behaviour change, but this was just removing some (I think) unintended behaviour, - Rebased onto current upstream/master branch, - No other changes since v9. In v9: - Rebased onto current upstream/master branch, - Minor testsuite fix to account for updated output from GDB, - No other changes since v8. In v8: - Rebased onto current upstream/master branch. - Reordered the patches a little. Patches 0 to 8 are unchanged from previous. If there's no objections then I'm planning to merge these some point soon as I think these are all good cleanup patches. - Patches 9, 10, and 11 are new. These are also refactoring commits, but are all tied pretty tightly to what is now patch 12. - Patch 12 is the most important patch. This has had a complete rewrite since V7 in order to address Tom's feedback. The general idea is unchanged; the breakpoint condition string is parsed first forwards, and then backwards, but we now have a two phase analysis, rather than immediately parsing things like the thread-id as we find them. This resolves this problem: (gdb) break some_function if ( 3 == thread ) Previous GDB would try to match 'thread )' as a thread-id and give an error that ')' as invalid. Now GDB correctly understands that the 'thread )' is likely part of the 'if' condition, and parses it as such. - Patches 13 and 14 are unchanged from V7. These patches depend on the changes in patch 12 so can't be merged without that patch. 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 (6): gdb: make breakpoint_debug_printf global gdb: add another overload of startswith gdb: create new is_thread_id helper function gdb: parse pending breakpoint thread/task immediately gdb: don't set breakpoint::pspace in create_breakpoint 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 | 702 ++++++++++++++++++ gdb/break-cond-parse.h | 52 ++ gdb/breakpoint.c | 664 ++++++++--------- gdb/breakpoint.h | 55 +- gdb/testsuite/gdb.ada/tasks.exp | 6 +- gdb/testsuite/gdb.base/condbreak.exp | 57 +- gdb/testsuite/gdb.base/pending.exp | 30 +- gdb/testsuite/gdb.linespec/explicit.exp | 14 +- gdb/testsuite/gdb.linespec/keywords.exp | 8 +- 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 | 14 +- .../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.exp | 206 +++++ 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 | 98 +++ gdb/tid-parse.c | 82 +- gdb/tid-parse.h | 8 + gdbsupport/common-utils.h | 10 + 30 files changed, 1983 insertions(+), 443 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.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: de5dc49e43574742556868f1ba5032cbe1a0cd73