From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by sourceware.org (Postfix) with ESMTPS id B915F382CCA6 for ; Fri, 20 May 2022 19:25:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B915F382CCA6 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f52.google.com with SMTP id e2so1127789wrc.1 for ; Fri, 20 May 2022 12:25:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=8E7CnbFKW0j0j1eSkVVlasUhILxQRD9YX3U4XyJE75g=; b=VbNeFWr+zZ7wcX/Z509D6B/FMxJT2ygA+UbxqZdPCA3JgQG4Ve4NqHgslcVP3ari9H zuVxJeXnJMtfUVAp2A8+w8Ofgs5wOJ1pRaL2QJKKFoMYclys3V3Efo0wUZAdwVUpMRVM DAIL1VFC5e/UmTZfB9nDe0f9pq372fbf45Jz+WO+fJAorjm/ffyo8yanCTM7M0PFjvfM 324RlJwCgxY3tP4qhYLn3fEGRFZ8c6y+xI4RM3N+nzsQV6d+1CUJ1phL33RiWC4XxdGP f9oRxoPCQzTkskzycfiHaH10oTlqwgLKaSoFTYzZdSPbmbS4Mygx/SYp1quQmKCDKQtY NqfA== X-Gm-Message-State: AOAM533vYH9Y1uDHVnJSZh9v6Qi/6sMh2EfuAeyBJNVseip+5T04UUZR AmdhO8t96LOBp2s2+vkPjVhkEAhcuN4HMg== X-Google-Smtp-Source: ABdhPJxucBxRZjD8jxkty+B1qjSPIgma2XyxShApnIbq47lwASzJOMxR2efu1cNVCjlSPjyMfoNvrg== X-Received: by 2002:adf:e890:0:b0:20d:80e:1140 with SMTP id d16-20020adfe890000000b0020d080e1140mr9443657wrm.649.1653074712710; Fri, 20 May 2022 12:25:12 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id n128-20020a1c2786000000b003942a244f50sm2694972wmn.41.2022.05.20.12.25.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 May 2022 12:25:12 -0700 (PDT) Message-ID: Date: Fri, 20 May 2022 20:25:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 20/23] Momentary breakpoints should have no breakpoint number Content-Language: en-US To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20220516184030.665489-1-pedro@palves.net> <20220516184030.665489-21-pedro@palves.net> <87bkvsb3e3.fsf@tromey.com> From: Pedro Alves In-Reply-To: <87bkvsb3e3.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, 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-List-Received-Date: Fri, 20 May 2022 19:25:15 -0000 On 2022-05-20 17:00, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > > Pedro> Momentary breakpoints have no breakpoint number, their breakpoint > Pedro> number should be always 0, to avoid constantly incrementing (or > Pedro> decrementing) the internal breakpoint count. > > Pedro> Indeed, set_momentary_breakpoint installs the created breakpoint > Pedro> without a number. > > Pedro> However, momentary_breakpoint_from_master incorrectly gives an > Pedro> internal breakpoint number to the new breakpoint. This commit fixes > Pedro> that. > > I think it would probably be good to document this somewhere. > Like, maybe the deleted line could be replaced with a comment. I think if we do it here, we'd need to do it in set_momentary_breakpoint too. I had already added such a comment on top of struct momentary_breakpoint, though, in patch #19: -/* Momentary breakpoints. */ +/* Momentary breakpoints. These typically have a lifetime of some run + control command only, are always thread-specific, and have 0 for + breakpoint number. I.e., there can be many momentary breakpoints + on the breakpoint chain and they all same the same number (zero). + They're visible in "maint info breakpoints", but not "info + breakpoints". */ struct momentary_breakpoint : public base_breakpoint { Maybe we could find a spot to put an assert at. Seems difficult without relying on checking breakpoint types, though...