From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 0CA7B3857C68 for ; Sun, 14 Mar 2021 05:45:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0CA7B3857C68 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47914) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLJYq-0008VT-Dc; Sun, 14 Mar 2021 00:45:08 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4549 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lLJYn-00047k-B9; Sun, 14 Mar 2021 00:45:05 -0500 Date: Sun, 14 Mar 2021 07:45:13 +0200 Message-Id: <83pn02gufq.fsf@gnu.org> From: Eli Zaretskii To: Simon Marchi , Hannes Domani Cc: gdb@sourceware.org In-Reply-To: <6005438b-e445-05f4-f063-d62016d2885a@polymtl.ca> (message from Simon Marchi on Sat, 13 Mar 2021 21:46:32 -0500) Subject: Re: Demangling in backtraces References: <83h7loun5e.fsf@gnu.org> <8335wzjuuk.fsf@gnu.org> <6005438b-e445-05f4-f063-d62016d2885a@polymtl.ca> X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Mar 2021 05:45:11 -0000 > From: Simon Marchi > Date: Sat, 13 Mar 2021 21:46:32 -0500 > > >> I have built a C program linked against libgccjit. When it crashes, > >> the backtrace shows mangled names, like this: > >> > >> #0 0x70f5ac3e in libgccjit-0!_Z17gimple_build_callP9tree_nodejz () > >> from D:\usr\bin\libgccjit-0.dll > >> #1 0x7190fa7b in libgccjit-0!_ZN19evrp_range_analyzer5leaveEP15basic_block_def > >> () from D:\usr\bin\libgccjit-0.dll > >> #2 0x71910eef in libgccjit-0!_Z36stmt_uses_0_or_null_in_undefined_wayP6gimple > >> () from D:\usr\bin\libgccjit-0.dll > >> #3 0x710fba2c in libgccjit-0!_Z16execute_one_passP8opt_pass () > >> from D:\usr\bin\libgccjit-0.dll > >> > >> (This is because libgccjit is written in C++, and because the DLL is > >> stripped.) > >> > >> How can I cause GDB to demangle the function names when showing the > >> backtrace in this case? I tried setting language to c++, but that > >> didn't help. > >> > >> TIA > >> > > I don't really know. I've tried making a toy program and shared library > on Linux in C++, without debug symbols, and it "just works": > > #0 0x00007ffff7fc00ed in foo(int) () from ./libfoo.so > #1 0x0000555555555147 in main () > > So maybe it's supposed to "just work" on Windows as well and it doesn't? > I don't really have time to dig into it further. Thanks. So does this mean we don't have any kind of "manual demangler" in GDB that could be turned on in cases like this, when "just works" doesn't? Hannes, any ideas?