From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +GqWATI/cWGySAAAWB0awg (envelope-from ) for ; Thu, 21 Oct 2021 06:21:38 -0400 Received: by simark.ca (Postfix, from userid 112) id 02C311F0BD; Thu, 21 Oct 2021 06:21:38 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 785AE1E79C for ; Thu, 21 Oct 2021 06:21:37 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B550C385803F for ; Thu, 21 Oct 2021 10:21:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B550C385803F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1634811696; bh=ozJlUkboz/z3LJddScoI7p6ukknJc2YLmqnVFkneGtk=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=WiLDV+J5lRBP1ZQ5xFy7PLzljJE6H7feHV2C9s6VSAWygxLzb/dBt646OI9EDmmlY SZUKFXVwR+loHyGQq5vlA5FyuDJ3eF72TntWiTLW3fENa7W5SufEWBVFlP1758DrLc ZNmlw0Q3KKXmzum2kwKIuG78sVGzWUmF6wdjRkM8= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id E2FFE3857C71 for ; Thu, 21 Oct 2021 10:20:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E2FFE3857C71 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 282781FDAD; Thu, 21 Oct 2021 10:20:54 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 001CD13BDA; Thu, 21 Oct 2021 10:20:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Gh9NOQU/cWFWSQAAMHmgww (envelope-from ); Thu, 21 Oct 2021 10:20:53 +0000 Subject: Re: [PATCH 8/9] gdb: remove iterate_over_breakpoints function To: Simon Marchi , gdb-patches@sourceware.org References: <20210527153558.3016335-1-simon.marchi@polymtl.ca> <20210527153558.3016335-9-simon.marchi@polymtl.ca> Message-ID: <83f04dc4-f756-0363-2e07-f81a6c384007@suse.de> Date: Thu, 21 Oct 2021 12:20:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210527153558.3016335-9-simon.marchi@polymtl.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Cc: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 5/27/21 5:35 PM, Simon Marchi via Gdb-patches wrote: > /* Create and register solib event breakpoints. PROBES is an array > diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c > index 738f69156485..afd51e95980c 100644 > --- a/gdb/tui/tui-winsource.c > +++ b/gdb/tui/tui-winsource.c > @@ -457,7 +457,7 @@ tui_source_window_base::update_breakpoint_info > do with it. Identify enable/disabled breakpoints as well as > those that we already hit. */ > tui_bp_flags mode = 0; > - iterate_over_breakpoints ([&] (breakpoint *bp) -> bool > + for (breakpoint *bp : all_breakpoints ()) > { > if (bp == being_deleted) > return false; > @@ -479,7 +479,8 @@ tui_source_window_base::update_breakpoint_info > } > } > return false; > - }); > + } > + > if (line->break_mode != mode) > { > line->break_mode = mode; > -- This changes a lambda function body to a loop body, but fails to update the two returns. Consequently, showing breakpoints in tui is broken (and unfortunately there's no test-case to detect that). This works for me: ... diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index afd51e95980..955b68901fe 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -460,7 +460,7 @@ tui_source_window_base::update_breakpoint_info for (breakpoint *bp : all_breakpoints ()) { if (bp == being_deleted) - return false; + continue; for (bp_location *loc : bp->locations ()) { @@ -478,7 +478,6 @@ tui_source_window_base::update_breakpoint_info mode |= TUI_BP_HARDWARE; } } - return false; } if (line->break_mode != mode) ... Thanks, - Tom