From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129627 invoked by alias); 21 Oct 2019 04:45:05 -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 129413 invoked by uid 89); 21 Oct 2019 04:45:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=meet, HContent-Transfer-Encoding:8bit X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Oct 2019 04:45:03 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 6363F2018B; Mon, 21 Oct 2019 00:45:01 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 023CB20183; Mon, 21 Oct 2019 00:44:59 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id D236121926; Mon, 21 Oct 2019 00:44:59 -0400 (EDT) X-Gerrit-PatchSet: 3 Date: Mon, 21 Oct 2019 04:45:00 -0000 From: "Simon Marchi (Code Review)" To: Christian Biesinger , gdb-patches@sourceware.org Cc: Tom Tromey Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v3] Replace some more qsort calls with std::sort X-Gerrit-Change-Id: Ibcddce12a3d07448701e731b7150fa23611d86de X-Gerrit-Change-Number: 131 X-Gerrit-ChangeURL: X-Gerrit-Commit: 39ef2f6256737db92f5d60fa201fe0b301bb8100 In-Reply-To: References: X-Gerrit-Comment-Date: Mon, 21 Oct 2019 00:44:59 -0400 Reply-To: simon.marchi@polymtl.ca, tromey@sourceware.org, cbiesinger@google.com, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3 Content-Type: text/plain; charset=UTF-8 Message-Id: <20191021044459.D236121926@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-10/txt/msg00711.txt.bz2 Simon Marchi has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/131 ...................................................................... Patch Set 3: It looks like this patch causes some regressions when building with -D_GLIBCXX_DEBUG=1. One such failure is in gdb.dwarf2/ada-linkage-name.exp (make check TESTS="gdb.dwarf2/ada-linkage-name.exp"). The problem is that the comparison functions don't have the required properties for std::sort: 49 /usr/include/c++/9.2.0/bits/stl_algo.h:4858:^M 50 In function:^M 51 void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = ^M 52 obj_section**; _Compare = bool (*)(const obj_section*, const ^M 53 obj_section*)]^M 54 ^M 55 Error: comparison doesn't meet irreflexive requirements, assert(!(a < a)).^M 56 ^M 57 Objects involved in the operation:^M 58 instance "functor" @ 0x0x7ffda9ccc9a0 {^M 59 type = bool (*)(obj_section const*, obj_section const*);^M 60 }^M 61 iterator::value_type "ordered type" {^M 62 type = obj_section*;^M 63 }^M It is probably a pre-existing bad behavior with the comparison functions, but using std::sort points those out. I would encourage you to use -D_GLIBCXX_DEBUG=1 all the time for your development builds (except for when you want to do benchmarks), it catches a bunch of things.