From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 90QLLtMLb2AtEQAAWB0awg (envelope-from ) for ; Thu, 08 Apr 2021 09:57:39 -0400 Received: by simark.ca (Postfix, from userid 112) id ADEFF1EE0E; Thu, 8 Apr 2021 09:57:39 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham 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 D63BD1E54D for ; Thu, 8 Apr 2021 09:57:38 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6D7DD3950C17; Thu, 8 Apr 2021 13:57:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D7DD3950C17 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1617890258; bh=CYkmFJ9c939SZBHgh2S0gOB7vRdSrAHF2bGKbnJB3Jg=; 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=HZgKknXyl+E3TmNT8qtaMwbZep8EZ4S/jePzW0LwtVdNUuMEexsWqjlxLsczKLnsF V+d+3SThnCgwOKC3nWNlST+vAcZdGvyBB15IawL5s88gNLMRKlHh+aEGMuucjPJA/W 9dUBP8lxVIZPUsQKzeyMAxS/WISEGkgGy8yH7W58= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 14B5A3947C02 for ; Thu, 8 Apr 2021 13:57:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 14B5A3947C02 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 138DvR6U023761 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 8 Apr 2021 09:57:32 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 138DvR6U023761 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (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 658271E54D; Thu, 8 Apr 2021 09:57:27 -0400 (EDT) Subject: Re: Subtle problems with "info sharedlibrary" on MS-Windows To: Eli Zaretskii References: <83czw7p4nd.fsf@gnu.org> <777379173.1335754.1615393830518@mail.yahoo.com> <83mtvbne96.fsf@gnu.org> <259022839.1083386.1615397702855@mail.yahoo.com> <83y2dwbow6.fsf@gnu.org> <83lf9vbljw.fsf@gnu.org> <83czv59rw1.fsf@gnu.org> Message-ID: Date: Thu, 8 Apr 2021 09:57:27 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <83czv59rw1.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 8 Apr 2021 13:57:27 +0000 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-04-08 3:06 a.m., Eli Zaretskii wrote: >> Cc: gdb-patches@sourceware.org >> From: Simon Marchi >> Date: Wed, 7 Apr 2021 17:18:08 -0400 >> >>> OK to commit to master (with a suitable ChangeLog entry)? >> >> The patch LGTM, see minor comments below. > > Thanks for your prompt review (and for the other help in investigating > this tricky problem). > >> According to our style guideline, we would use >> >> dll_name != nullptr > > Does this also mean the GDB style prefers, e.g., > > if (load_addr == nullptr) > > to > > if (!load_addr) > > ? Because you didn't comment on those lines, only on those where the > value is tested for NOT being null. Exactly, sorry for not being clear. We always want explicit comparison with nullptr for pointers, whether that is == or !=. Same for integers that are not used as booleans, we want if (item_count == 0) and not if (!item_count) This is described here: https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#Comparison_With_nullptr_And_Zero >>> + if (!(load_addr && mi.lpBaseOfDll != load_addr)) >> >> Perhaps matter of personal preference, but I would understand it better >> (less mental steps) as >> >> if (!load_addr || mi.lpBaseOfDll == load_addr) > > I feel the other way around, but maybe I'm the odd one out here. > Pedro, Joel: what say you? > > In any case, I guess I could add a comment there explaining the logic > in plain English, so everyone would understand the intent. That's alright, leave it the way it is. But a comment explaining the intent is always welcome, in my book. Thanks, Simon