From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id DBE87385701E; Mon, 3 May 2021 20:17:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DBE87385701E Received: by mail-wr1-x435.google.com with SMTP id h4so6887130wrt.12; Mon, 03 May 2021 13:17:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=mNQqhvrX2D1PFR27rFfdJmDIx/venUOVYa6BVYMxQNQ=; b=BeB/8yy1rWjYpO+Fp+c8vfoPQ0cp5IopPTwarV8tUcxWPfFjtP31H8Xn3Vm1XxTl82 7yfi6Q5xOaItQo8P8d8YYWB6hiBN7Po1czybLkxLqKV87FN2KRAGMsVQ5XsjuIg7MQg/ r8kqqrBBT9fukQERhh/KvcYL7T5ErBy9ETay5QAMkDoQTLtdF3HhOn5cMQcyXKy65x/E +L1EYcQWIjOhnVkrPbF1Q52zLEYe5o7gjOm4gIWFE0PujEvGvcaWpCh7Jdla8EWh/AyS Fg26GK6u79s0TXi3CyJHrROL2z6L96D3zE36Qm1FR/YiiLR0ylbSA1+0cC7y/hZ/PhGh kkyw== X-Gm-Message-State: AOAM533T912dfuvBTXCg1UZghnKTFKa9Uvnv7RHTJ52bXNOgUj8GC02v dT92p5XM+832Jv6wNADpK11afuDDLWb56A== X-Google-Smtp-Source: ABdhPJwlI8UEwYzBiJzXtbMKHhsnIPjbmY4fzs+dabAud1dRDnW5SFOrM5Wb7OvTolFsnDI0avtTNA== X-Received: by 2002:adf:f1d1:: with SMTP id z17mr27169241wro.249.1620073023699; Mon, 03 May 2021 13:17:03 -0700 (PDT) Received: from ?IPv6:2a01:e0a:1dc:b1c0:54b0:bb07:87d7:c9a6? ([2a01:e0a:1dc:b1c0:54b0:bb07:87d7:c9a6]) by smtp.googlemail.com with ESMTPSA id c15sm13888521wrr.3.2021.05.03.13.17.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 May 2021 13:17:03 -0700 (PDT) Subject: Re: [PATCH][_GLIBCXX_DEBUG] libbacktrace integration From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= To: "libstdc++@gcc.gnu.org" Cc: gcc-patches References: Message-ID: Date: Mon, 3 May 2021 22:17:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: fr X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 May 2021 20:17:15 -0000 Is it too early to consider this patch ? Or just lack of time ? Considering the patch I would really appreciate that, if validated, it gets in as early as possible in next release. Thanks, François On 24/04/21 3:46 pm, François Dumont wrote: > Hi > >     Here is the patch to add backtrace generation on _GLIBCXX_DEBUG > assertions thanks to libbacktrace. > >     In addition to this integration I am also improving the generation > of the assertion message thanks to the "%.*s" printf format, it avoids > an intermediate buffer most of the time. I am also removing the "__" > used for uglification to get a nicer output. I can propose it in a > dedicated patch if you prefer. > >     I am adding GLIBCXX_3.4.30 abi version to properly export the 2 > new weak symbols. Let me know if it isn't necessary. > >     libstdc++: [_GLIBCXX_DEBUG] Add backtrace generation thanks to > libbacktrace > >       Add _GLIBCXX_DEBUG_BACKTRACE macro to activate backtrace > generation on >     _GLIBCXX_DEBUG assertions using libbacktrace. > >             * config/abi/pre/gnu.ver: Add GLIBCXX_3.4.30 version and > new exports. >             * include/debug/formatter.h [_GLIBCXX_DEBUG_BACKTRACE]: >             Include . >             [_GLIBCXX_DEBUG_BACKTRACE && BACKTRACE_SUPPORTED]: >             Include . >             [(!_GLIBCXX_DEBUG_BACKTRACE || !BACKTRACE_SUPPORTED) && >             _GLIBCXX_USE_C99_STDINT_TR1]: Include . >             [_GLIBCXX_DEBUG_USE_LIBBACKTRACE] >             (__gnu_debug::__create_backtrace_state): New. >             [_GLIBCXX_DEBUG_USE_LIBBACKTRACE] >             (__gnu_debug::__render_backtrace): New. > [_GLIBCXX_DEBUG_USE_LIBBACKTRACE](_Error_formatter::_M_print_backtrace): >             New. > [_GLIBCXX_DEBUG_USE_LIBBACKTRACE](_Error_formatter::_M_backtrace_state): >             New. >             (_Error_formatter::_Error_formatter): Outline definition. >             * src/c++11/debug.cc: Include . >             (_Print_func_t): New. >             (print_word): Use '%.*s' format in fprintf to render only > expected >             number of chars. >             (print_raw(PrintContext&, const char*, ptrdiff_t)): New. >             (print_function(PrintContext&, const char*, > _Print_func_t)): New. >             (print_type): Use latter. >             (print_string(PrintContext&, const char*, const > _Parameter*, size_t)): >             Change signature to... >             (print_string(PrintContext&, const char*, ptrdiff_t, const > _Parameter*, >             size_t)): ...this and adapt. Remove intermediate buffer to > render input >             string. >             (print_string(PrintContext&, const char*, ptrdiff_t)): New. >             [_GLIBCXX_DEBUG_USE_LIBBACKTRACE] >             (print_backtrace(void*, uintptr_t, const char*, int, const > char*)): New. >             (_Error_formatter::_M_error()): Adapt. >             [_GLIBCXX_DEBUG_USE_LIBBACKTRACE] >             (__gnu_debug::__create_backtrace_state): New, weak symbol. >             [_GLIBCXX_DEBUG_USE_LIBBACKTRACE] >             (__gnu_debug::__render_backtrace): New, weak symbol. >             * testsuite/util/testsuite_abi.cc: Add new symbol version. >             * doc/xml/manual/debug_mode.xml: Document > _GLIBCXX_DEBUG_BACKTRACE. >             * doc/xml/manual/using.xml: Likewise. > > Tested under Linux x86_64. > > Ok to commit ? > > François >