From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 343FB3858401 for ; Thu, 18 May 2023 17:55:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 343FB3858401 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.170] (unknown [167.248.160.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 9B3941E0D6; Thu, 18 May 2023 13:55:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1684432504; bh=d3zrzq46fQpaGGIXp6b6tqP1e7rnkzhyCmVIev/v9Go=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=tIJx/jS1RMeomsBxc9cOBdRT/sx6eREPcCybI9+MstkXp2dLfyigEcLrzJ18Biy0h coNLYX+yL9/Ak71oFnj67Ds1pe9MkPJLh71z4cXPMqgFXZmVTD5jgeZcyG+JIImeLE BckpbR1DoQ0XLUGky0pABDVHmIJIP7dsiF5j/eiM= Message-ID: <30acd91d-90ad-9f44-a859-e13765d644c7@simark.ca> Date: Thu, 18 May 2023 13:55:04 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 05/12] gdb: add breakpoint::first_loc methods Content-Language: fr To: Andrew Burgess , Simon Marchi via Gdb-patches Cc: Simon Marchi References: <20230511144832.17974-1-simon.marchi@efficios.com> <20230511144832.17974-6-simon.marchi@efficios.com> <87edndajm8.fsf@redhat.com> From: Simon Marchi In-Reply-To: <87edndajm8.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,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 List-Id: On 5/18/23 08:50, Andrew Burgess via Gdb-patches wrote: > Simon Marchi via Gdb-patches writes: > >> Add convenience first_loc methods to struct breakpoint (const and >> non-const overloads). A subsequent patch changes the list of locations >> to be an intrusive_list and makes the actual list private, so these >> spots would need to become something ugly like: >> >> -b->loc >> +*b->locations ().begin () > > It took me longer than I'd like to admit to realise the leading -/+ here > were indicating that this was an extract from a diff. Maybe there's > some way to make it clearer? Or just drop the first line, I think the > second line is clear enough (given the description before). Sorry, I thought I was being smart writing it this way. I'll change it to say, these spots would need from: b->loc to something ugly like: b->locations ().begin () >> @@ -8178,17 +8177,18 @@ momentary_breakpoint_from_master (struct breakpoint *orig, >> std::unique_ptr copy >> (new_momentary_breakpoint (orig->gdbarch, type, orig->pspace, >> orig->frame_id, thread)); >> + bp_location &orig_loc = orig->first_loc (); > > Maybe 'const bp_location &' ? Yes, changed. > Otherwise, looks good. Thanks, Simon