From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id G2xJNq78kV/tSwAAWB0awg (envelope-from ) for ; Thu, 22 Oct 2020 17:42:06 -0400 Received: by simark.ca (Postfix, from userid 112) id D1A951EFC7; Thu, 22 Oct 2020 17:42:06 -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.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 539911E776 for ; Thu, 22 Oct 2020 17:42:06 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EABCA398747D; Thu, 22 Oct 2020 21:42:05 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 7E409384400A for ; Thu, 22 Oct 2020 21:42:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7E409384400A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 1F5641E552; Thu, 22 Oct 2020 17:42:02 -0400 (EDT) Subject: Re: [committed][gdb/symtab] Make find_block_in_blockvector more robust To: Tom de Vries , Tom Tromey References: <20201022152431.GA13910@delia> <87ft66144u.fsf@tromey.com> <8d84b50e-530a-a33c-b523-c72305438c19@suse.de> From: Simon Marchi Message-ID: <4052e022-30fd-b24e-2ad6-53eb4d790d85@simark.ca> Date: Thu, 22 Oct 2020 17:42:01 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <8d84b50e-530a-a33c-b523-c72305438c19@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: fr 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: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-10-22 5:21 p.m., Tom de Vries wrote: > On 10/22/20 8:56 PM, Tom Tromey wrote: >>>>>>> "Tom" == Tom de Vries writes: >> >> Tom> + if (!(BLOCK_START (b) <= pc)) >> Tom> + return NULL; >> >> This seems a bit weird to me, in that if BLOCK_START(b) == pc, then I >> would be inclined to say that the pc is in fact in that block. >> > > So if BLOCK_START(b) == pc, indeed the pc is in the block, and we have: > ... > if (!(true)) > return NULL; > ... > which I'd say correctly handles that case. > > Thanks, > - Tom > I think that turning: if (!(BLOCK_START (b) <= pc)) into if (BLOCK_START (b) > pc) or if (pc < BLOCK_START (b)) would make it easier to read. Simon