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 EF19C3858D1E for ; Sat, 11 Mar 2023 03:21:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF19C3858D1E 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.11] (unknown [217.28.27.60]) (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 9DD5A1E128; Fri, 10 Mar 2023 22:21:20 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1678504880; bh=dazlEq4Pu30zIrR17zCszPXuc09T9He8g7wbJH18Igs=; h=Date:Subject:To:References:From:In-Reply-To:From; b=uSWPqErjJRzAMiHRS5HxaYaBSN4+HKL8OZgKsqQXylOtoxgnXwfw5nizwgQAsra+F FHtcC2SwyhWCxOmW6OkhvSD1j6ig7Ni+4RgEczGWGWSRJnQq/ikJISIMKOu6W7UR1S sxC1UQ4feXxodBXC4AATWuAARDwg3kd9NRhK0YDY= Message-ID: Date: Fri, 10 Mar 2023 22:21:19 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH 1/5] Add operator< and operator== to linetable_entry Content-Language: en-US To: Tom Tromey , gdb-patches@sourceware.org References: <20230308-submit-constify-linetable-v1-0-ca4057478141@tromey.com> <20230308-submit-constify-linetable-v1-1-ca4057478141@tromey.com> From: Simon Marchi In-Reply-To: <20230308-submit-constify-linetable-v1-1-ca4057478141@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP 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: > diff --git a/gdb/symtab.h b/gdb/symtab.h > index c565bc8eac4..69f0eaa0f88 100644 > --- a/gdb/symtab.h > +++ b/gdb/symtab.h > @@ -1547,6 +1547,19 @@ struct rust_vtable_symbol : public symbol > > struct linetable_entry > { > + bool operator< (const linetable_entry &other) const > + { > + if (pc == other.pc > + && (line != 0) != (other.line != 0)) > + return line == 0; > + return pc < other.pc; > + } The way this is written looks a bit complicated to me, but this is pre-existing code, so it's fine. Simon