From patchwork Fri Apr 28 23:35:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 55727 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 9C256385771A for ; Fri, 28 Apr 2023 23:37:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C256385771A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682725056; bh=S35XLh7YnlzO6yR1P/YYQCzrGYZKjzMt28KnTiyl+oA=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=yVGGAubd1DvV6ViYiKNqhml+mq/2ofKy1sX67vzVvvJCEcScgrSsIyRXJzv6sMLG0 iOJ1mrW04B/dD+O9J6KZ7aYzzzn8zKnrE9hWM/xBJrouLTUTCr908Pb2bNbaA9G/ew qxUM77+ljdnT1EfC6XRTHXAl2JnMcJR3rdr6/gGo= 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 262FF3857708 for ; Fri, 28 Apr 2023 23:35:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 262FF3857708 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-472-Ve01VvVFPtGI23tLnRcntA-1; Fri, 28 Apr 2023 19:35:49 -0400 X-MC-Unique: Ve01VvVFPtGI23tLnRcntA-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-2f8c2258b48so83066f8f.1 for ; Fri, 28 Apr 2023 16:35:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682724948; x=1685316948; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=S35XLh7YnlzO6yR1P/YYQCzrGYZKjzMt28KnTiyl+oA=; b=Ug/Xt2BQGeW6Dnbczbv2a/GjjxUTH9o3cWJPV9Lyf/t68CUpYCOPQby++mwkVcXupZ oKBv3zXw8jwZruRltYU2QfSB9OJlcoxn4lmHmT+GuHOKt1EoSLVGjNj5kjtEZOWynnG9 jyVTJrtMXqK+HICupvPsP+o2GoZsGskfmQ2TE0Ec9uV0nx9zQ7Qp9MK4uN7/fxS2kJuw EWkZRG/6jXTJcg/UQ19Nm+1Qj/0g01sxKAUygsu8Jrnl8AVPN9MuOKhOl4rkc+Y0ZqYP TbC/JgPZeUlJnuqkixJpRshG3KcAxUnAXkfwGXZfbQdONtlK81TRYZMRz/XtYON5X5el OYQQ== X-Gm-Message-State: AC+VfDyC8RVqeOtff3tZFw1jXVS/mLKZP15FnlIftFFsZWJazAO3xr7w shJK5072J1jynJHO3kZBcu7eH1UgCmTmcpTRNiR6u3r6gQ6al61r9iAsUhwZLlK5+FFxyK7IaV+ ERmG4npKWeZlLgkzTmD/GypcUTe4SySsSMzCpwhdq/yH7DlBGoyIEm4cZ3ZQQLPRyXLV0rBKHiV DfB5UNYw== X-Received: by 2002:a5d:5387:0:b0:2fb:9dbb:3407 with SMTP id d7-20020a5d5387000000b002fb9dbb3407mr5196070wrv.51.1682724947965; Fri, 28 Apr 2023 16:35:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72tYKb7lYCavPoM19dj7x+fMv6gCFTtWn0azBgnTSnIKpgFP3LV+CF0A3ahGjvhyBOLTwAnQ== X-Received: by 2002:a5d:5387:0:b0:2fb:9dbb:3407 with SMTP id d7-20020a5d5387000000b002fb9dbb3407mr5196059wrv.51.1682724947632; Fri, 28 Apr 2023 16:35:47 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id t15-20020adfe44f000000b002f00793bd7asm22069211wrm.27.2023.04.28.16.35.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Apr 2023 16:35:47 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 0/9] thread-specific breakpoints in just some inferiors Date: Sat, 29 Apr 2023 00:35:36 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-5.5 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_H2, 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When I proposed my inferior-specific breakpoints patch, two people independently asked: will these breakpoints only be inserted into the relevant inferiors? My answer at that point was, no, that's just not possible given how we manage the breakpoint locations, but this series changes that. But as the inferior specific breakpoints patch hasn't landed yet, this series looks at thread-specific breakpoints. A thread-specific breakpoint only applies to a single global thread-id, and so will only apply for to a single thread in a single inferior. As such, we can limit the locations for a thread-specific breakpoint to just those locations in the inferior containing the thread we are interested in. In the following series patch #6 and #9 are the really interesting ones. Patch #6 makes some pretty significant changes to how we setup breakpoints, which opens the way for #9, which performs the location limiting. Patches #1 to #5 are me just trying to understand the breakpoint creation code more -- adding asserts and making a couple of minor cleanups. Patches #7 and #8 are more cleanups, but now looking at the location creation/re-setting code. --- Andrew Burgess (9): gdb: create_breakpoint: assert for a valid thread-id 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: 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 | 403 +++++++++++ gdb/break-cond-parse.h | 47 ++ gdb/breakpoint.c | 666 ++++++++---------- gdb/breakpoint.h | 64 +- gdb/testsuite/gdb.base/condbreak.exp | 20 +- gdb/testsuite/gdb.base/pending.exp | 23 +- gdb/testsuite/gdb.linespec/explicit.exp | 4 +- gdb/testsuite/gdb.mi/mi-dprintf-pending.exp | 3 +- .../gdb.mi/user-selected-context-sync.exp | 2 +- .../gdb.multi/bp-thread-specific.exp | 7 +- .../gdb.multi/multi-target-continue.exp | 2 +- .../gdb.multi/multi-target-ping-pong-next.exp | 4 +- gdb/testsuite/gdb.multi/pending-bp-lib.c | 22 + gdb/testsuite/gdb.multi/pending-bp.c | 66 ++ gdb/testsuite/gdb.multi/pending-bp.exp | 321 +++++++++ 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 +++ 23 files changed, 1498 insertions(+), 402 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-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: 00cdd79a5d3f910c1362b9c4654adea3db0a97de