From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82001 invoked by alias); 20 Nov 2017 00:42:02 -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 81945 invoked by uid 89); 20 Nov 2017 00:42:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=one's, Hx-languages-length:1319 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Nov 2017 00:42:01 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 50C1F81DF0; Mon, 20 Nov 2017 00:41:59 +0000 (UTC) Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id A66CC600C8; Mon, 20 Nov 2017 00:41:58 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 3/3] Fix mapped_index::find_name_components_bounds upper bound computation Date: Mon, 20 Nov 2017 00:42:00 -0000 Message-Id: <1511138515-25996-3-git-send-email-palves@redhat.com> In-Reply-To: <5d721d13-d886-0400-db6b-76485c545142@redhat.com> References: <5d721d13-d886-0400-db6b-76485c545142@redhat.com> X-SW-Source: 2017-11/txt/msg00387.txt.bz2 Here we want to find where we'd insert "after", so we want std::lower_bound, not std::upper_bound. gdb/ChangeLog: yyyy-mm-dd Pedro Alves * dwarf2read.c (mapped_index::find_name_components_bounds) : Use std::lower_bound instead of std::upper_bound. (test_mapped_index_find_name_component_bounds): Remove incorrect "t1_fund" from expected symbols. --- gdb/dwarf2read.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 53548ca..c4d1254 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -4319,8 +4319,8 @@ mapped_index::find_name_components_bounds std::string after = make_sort_after_prefix_name (cplus); if (after.empty ()) return end; - return std::upper_bound (lower, end, after.c_str (), - lookup_compare_upper); + return std::lower_bound (lower, end, after.c_str (), + lookup_compare_lower); } else return std::upper_bound (lower, end, cplus, lookup_compare_upper); @@ -4659,7 +4659,6 @@ test_mapped_index_find_name_component_bounds () static const char *expected_syms[] = { "t1_func", "t1_func1", - "t1_fund", /* This one's incorrect. */ }; SELF_CHECK (check_find_bounds_finds (mock_index.index (), -- 2.5.5