From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2820 invoked by alias); 20 May 2015 10:20:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 2803 invoked by uid 89); 20 May 2015 10:20:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 20 May 2015 10:20:00 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4KAJwPv029641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 May 2015 06:19:58 -0400 Received: from localhost (ovpn-116-129.ams2.redhat.com [10.36.116.129]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4KAJvTJ026660; Wed, 20 May 2015 06:19:58 -0400 Date: Wed, 20 May 2015 10:38:00 -0000 From: Jonathan Wakely To: =?iso-8859-1?Q?Fran=E7ois?= Dumont Cc: "libstdc++@gcc.gnu.org" , gcc-patches Subject: Re: Demangle symbols in debug assertion messages Message-ID: <20150520101957.GI30202@redhat.com> References: <5547D73C.6070602@gmail.com> <20150520101743.GH30202@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150520101743.GH30202@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-05/txt/msg01803.txt.bz2 On 20/05/15 11:17 +0100, Jonathan Wakely wrote: >On 04/05/15 22:31 +0200, François Dumont wrote: >>Hi >> >> Here is the patch to demangle symbols in debug messages. I have >>also simplify code in formatter.h. >> >> Here is an example of assertion message: >> >>/home/fdt/dev/gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/include/debug/functions.h:213: >> error: function requires a valid iterator range [__first, __last). >> >>Objects involved in the operation: >>iterator "__first" @ 0x0x7fff165d68b0 { >> type = >>__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator>std::__cxx1998::vector > >, >>std::__debug::vector > > (mutable >>iterator); >> state = dereferenceable; >> references sequence with type `std::__debug::vector>std::allocator >' @ 0x0x7fff165d69d0 >>} >>iterator "__last" @ 0x0x7fff165d68e0 { >> type = >>__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator>std::__cxx1998::vector > >, >>std::__debug::vector > > (mutable >>iterator); >> state = dereferenceable; >> references sequence with type `std::__debug::vector>std::allocator >' @ 0x0x7fff165d69d0 >>} >> >> >> * include/debug/formatter.h (_GLIBCXX_TYPEID): New macro to simplify >> usage of typeid. >> (_Error_formatter::_M_print_type): New. >> * src/c++11/debug.cc >> (_Error_formatter::_Parameter::_M_print_field): Use latter. >> (_Error_formatter::_M_print_type): Implement latter using >> __cxaabiv1::__cxa_demangle to print demangled type name. >> >>I just hope that __cxa_demangle is portable. > >It's provided by GCC itself so is always available in the runtime. >(It is also portable, because it's defined by the Itanium C++ ABI). > > >>Ok to commit ? > >Yes, this is great, thanks! Does this fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65392 ?