From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48091 invoked by alias); 24 Jan 2020 17:35:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 48083 invoked by uid 89); 24 Jan 2020 17:35:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.50.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Jan 2020 17:35:11 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway24.websitewelcome.com (Postfix) with ESMTP id EA45819353 for ; Fri, 24 Jan 2020 11:35:09 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id v2rNi15q4uRkOv2rNiLMvW; Fri, 24 Jan 2020 11:35:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=F1O4gt8HMnsel17WQzfdGZLTXs02hSKYHbWrXWhCSvc=; b=xJet41O7m/WjFNaR9IJQjk9S5E O/HJHgOzv9PW0FDnfLxcuTJdPtic7RCb6BGmxwVF1nE7nam3q0p5QyYzKUhxVOMCINCtlcLw0xx9/ qCNsj0xgiq8A5+yX0AsDyPc4c; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:60972 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iv2rN-0041tz-Lh; Fri, 24 Jan 2020 10:35:09 -0700 From: Tom Tromey To: Andrew Burgess Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/3] gdb: Don't reorder line table entries too much when sorting. References: Date: Fri, 24 Jan 2020 17:40:00 -0000 In-Reply-To: (Andrew Burgess's message of "Mon, 23 Dec 2019 01:51:06 +0000") Message-ID: <87d0b8ahbn.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2020-01/txt/msg00819.txt.bz2 >>>>> "Andrew" == Andrew Burgess writes: Andrew> Don't reorder line table entries for the same address when sorting the Andrew> line table, maintain the compiler given line order. Usually this will Andrew> reflect the order in which lines are conceptually encountered at a Andrew> given address. Thanks for the long explanation and the patch. I had a couple minor nits. Andrew> - /* Like the pending blocks, the line table may be Andrew> - scrambled in reordered executables. Sort it if Andrew> - OBJF_REORDERED is true. */ Andrew> + const auto lte_is_less_than Andrew> + = [] (const linetable_entry &ln1, Andrew> + const linetable_entry &ln2)->bool I'd put spaces around the "->". Andrew> + { Andrew> + /* Note: this code does not assume that CORE_ADDRs can fit Andrew> + in ints. Please keep it that way. */ Andrew> + return (ln1.pc < ln2.pc); I don't think this comment adds anything any more. IMO it can just be dropped. Tom