From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id zpZuHN1gdmQTIRkAWB0awg (envelope-from ) for ; Tue, 30 May 2023 16:47:25 -0400 Received: by simark.ca (Postfix, from userid 112) id 6CE9A1E11E; Tue, 30 May 2023 16:47:25 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=QFMiyZLr; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D50C71E0D4 for ; Tue, 30 May 2023 16:47:24 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B47AC3855882 for ; Tue, 30 May 2023 20:47:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B47AC3855882 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685479643; bh=G94qd7R+Jy1UZwgc4HFucCEUcwJ3dIHiCEJftrfbVOI=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=QFMiyZLrEajS7w+lN19oBPxcGGxXKx+Du4u5B4NzMzX9oOz5J1rIfLWOxoVqMcWsF nlwdypWz3Dh9KAkeHD5KEEiiWn1UrVLJM3DgjLzs289pYDzmpCS04xS2C7oJ87BqP3 7lMoKX0jHUSxLKy2FTUim8IeF/e95VeDHCTVqEYE= 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 B7C7B3858D28 for ; Tue, 30 May 2023 20:47:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B7C7B3858D28 Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-u6QWGiO5PGK_M107bNmHkQ-1; Tue, 30 May 2023 16:47:00 -0400 X-MC-Unique: u6QWGiO5PGK_M107bNmHkQ-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-4f4b64cd0daso2723570e87.3 for ; Tue, 30 May 2023 13:46:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685479618; x=1688071618; 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=G94qd7R+Jy1UZwgc4HFucCEUcwJ3dIHiCEJftrfbVOI=; b=hxk8T/LU3JDJ1x/haT0a4aQ4GQL3GpugLw7/HPoCZ6Xfntgu7l/6cVtDCRhjE+J1iN y3Dgqx6VWG34RLx7hbi/7+8rQ7RmLRFoQCuSkCkoIuYgezv0b/XQl9KR5LEi9GQOjNB6 zsqbz4nh+0ADviFTSW1DfXouE2VUOd3rWPFxtMvYo2l2tcMH0ygwiSr4WvkzODBUhn+E s7A8CnGDg54onCfTErQx7tXduO26Fs9uych5YXMHYGwiI1bqu2cUGDzcLeDgZ9Rg9PZX r5xsM+v6sANTfm2YFds7CCdSiXOZXJoDW7XtIu3xSpjM/huTrLwmhL5qZGo7L3LRmszl 95nQ== X-Gm-Message-State: AC+VfDz8oZ9PSlqXlSGxM70vYHIZn3l5CtFFNyzvAg8I5ih5UqX/dK9h oh2cYIbYzm7uRajwUbpFGoJj+VyKjC69sX3tkrYUS6sXA/rzH6ThU8Cy1rOqgDSuNYwqPBT0L5o sWYbL5/HRgf3jpzEK6wCYw9pmrl6Nl/6M5AYuDEbLV1Ce9+ilDvqA3Jz9PS9lzRWvCwTAdfd8wH fsOAuCHQ== X-Received: by 2002:ac2:4435:0:b0:4f4:b0d0:63fb with SMTP id w21-20020ac24435000000b004f4b0d063fbmr1292213lfl.35.1685479618059; Tue, 30 May 2023 13:46:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7XQtWNqkZNJyGdd0OzJ4XEs9lHCJHDha5fM8USNdaqpENLjWQjmDJIBSi+5fU0iIHlOX90Yg== X-Received: by 2002:ac2:4435:0:b0:4f4:b0d0:63fb with SMTP id w21-20020ac24435000000b004f4b0d063fbmr1292204lfl.35.1685479617647; Tue, 30 May 2023 13:46:57 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id u14-20020adfeb4e000000b003062b6a522bsm4261007wrn.96.2023.05.30.13.46.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 13:46:57 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv3 0/9] thread-specific breakpoints in just some inferiors Date: Tue, 30 May 2023 21:46:44 +0100 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@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. --- 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 (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: 2bd766d6245bf9db77c42da3537c949ffb814bfc -- 2.25.4