From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 7B7FB3888C58 for ; Thu, 24 Mar 2022 08:01:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7B7FB3888C58 Received: by mail-wm1-x334.google.com with SMTP id q20so2213925wmq.1 for ; Thu, 24 Mar 2022 01:01:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=SMZoz12iGF/POn/6wpPJm0yRyE9vnmmDs/vF63G1714=; b=CN8hYRVcuUpexYUT4dDaOY35XOkz/QJUJ6iXs+pXnYxG4grgM8PFKL4QJmJwhVv0LX 7xhI53pAQ42zPG/IwZldSVsDEDfr31IF6FMJf091ruZ+i7J55Uz9KkvhUs/5kes4Py2o tLNp82lJdQueS4WX0nel4d+iqJosEV+Lms4RQTqmYZw4UsNTOkTESaJ5xgAyGrom+xKH RMGURDQF1Y72QmmVzFysvTuncZTWUoecCtb3VkMTbdSThfwdu1ZdPkYBd+Iu6CY7aDfl VguGqzHZkO0EMDJs/apdYiBujhC4pjR8A0ZnAuRCVB90tu1MxspIGlNZx8t0gYqIUaM3 Z8vA== X-Gm-Message-State: AOAM531AcwwWqThj/5MC2MGRb3f//yEHOWIMMxDBzIT+O2aa8XDSWYQq atKOMqItmfd/SZBzK7rmoxEkTQ== X-Google-Smtp-Source: ABdhPJxj6JVip8gC4zZNxygqzcAsRqj3PttQ/HbeK6LFUT39PEv8xCFksGqDAbSdLvLYiWFJlIS59Q== X-Received: by 2002:a1c:4e18:0:b0:38c:bd8d:6bd9 with SMTP id g24-20020a1c4e18000000b0038cbd8d6bd9mr3530973wmh.94.1648108902609; Thu, 24 Mar 2022 01:01:42 -0700 (PDT) Received: from google.com (110.121.148.146.bc.googleusercontent.com. [146.148.121.110]) by smtp.gmail.com with ESMTPSA id f8-20020a05600c154800b0038cc1acc02fsm3561053wmg.24.2022.03.24.01.01.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 01:01:41 -0700 (PDT) Date: Thu, 24 Mar 2022 09:01:38 +0100 From: "Steinar H. Gunderson" To: Alan Modra Cc: Nick Clifton , binutils@sourceware.org, sesse@chromium.org Subject: Re: [PATCH] Add a trie to map quickly from address range to compilation unit. Message-ID: References: <20220321094030.1256430-1-sesse@google.com> <63191455-2374-5db9-f55e-ddf794c7d88e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-19.0 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2022 08:01:46 -0000 On Thu, Mar 24, 2022 at 03:52:27PM +1030, Alan Modra wrote: > Huh, I remember looking at this code a while ago and finding it > confusing. I think the code would be clearer, and behave the same on > normal line number info with the following patch: An interesting question is: Do you want to keep searching through compilation units once you've found a match with a line number? Should we go straight to “goto done” then? Currently, it seems that even if we find a match with line numbers, we keep searching for a more specific match (range <= min_range) in different compilation units... but only among compilation units we've already parsed debug information for. If we have a line number by then, we stop searching; we only parse new units if we're line-number-less or have no match at all. And if we find a match, no matter how bad, in those new units, we accept it and stop searching, no matter whether we have line numbers or if it's a more specific match or not. (Is that a correct interpretation?) Your patch changes the exit-after-already-parsed to also include a match _without_ line numbers. It's a change, but I don't know if it's intended. My patch, as a side effect, introduces the more-specific logic into the second loop, where it wasn't before. /* Steinar */