From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp002.apm-internet.net (smtp002.apm-internet.net [85.119.248.221]) by sourceware.org (Postfix) with ESMTPS id F210B385781B for ; Sat, 3 Apr 2021 19:36:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F210B385781B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=iain@sandoe.co.uk Received: (qmail 80997 invoked from network); 3 Apr 2021 19:36:08 -0000 X-APM-Out-ID: 16174785688099 X-APM-Authkey: 257869/1(257869/1) 4 Received: from unknown (HELO ?192.168.1.212?) (81.138.1.83) by smtp002.apm-internet.net with SMTP; 3 Apr 2021 19:36:08 -0000 Content-Type: text/plain; charset=utf-8; delsp=yes; format=flowed Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: DWARF debug info version on macOS and 'std::' namespace (and pretty-printers) From: Iain Sandoe In-Reply-To: Date: Sat, 3 Apr 2021 20:36:07 +0100 Cc: Jonathan Wakely , Jonathan Wakely , libstdc++ Content-Transfer-Encoding: 8bit Message-Id: <8311DE88-40EF-4E1F-8831-A0707F2E53A2@sandoe.co.uk> References: <20210305181946.GY3008@redhat.com> <604ee4a4-7936-6d4e-f062-137b2c884d36@gmail.com> To: Philippe Blain X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2021 19:36:11 -0000 Hi Philippe, Philippe Blain wrote: > Le 2021-03-07 à 11:07, Jonathan Wakely a écrit : >> On 07/03/21 12:23 +0000, Iain Sandoe wrote: >>> Jonathan Wakely wrote: >>> >>>> On Sun, 7 Mar 2021, 05:12 Philippe Blain via Libstdc++, >>>> wrote: >>>> >>>> I would think it's what GCC emits though, since LLDB acts similarly >>>> (although >>>> I could be wrong…) >>> (unfortunately, I’m not familiar with exactly what language features >>> can be represented by each DWARF revision but, hypothetically, it could >>> be that something in the current sources is not representable properly >>> by DWARF-2) >>> >>> >>> So I think one would have to try “-gdwarf-2 -gstrict-dwarf -g” on >> Ah, I wasn't using -gstrict-dwarf but if I add that I can reproduce >> the problem on GNU/Linux with current versions of GCC and GDB. > > Looking at the summary of the changes in DWARF 3 [1] it seems > C++ namespaces were added in that revision of the standard, so maybe > in a way it does make sense for "-gdwarf-2 -gstrict-dwarf -g" to not show > 'vector' in the 'std' namespace since DWARF 2 does not know about > namespaces… indeed > > [1] http://dwarfstd.org/Dwarf3Std.php thanks for doing the checking! ---- For GCC12, at least for macOS >= 10.10, I am going to look into changing the default to DWARF-4. The problem is not really with GCC itself, but that GCC relies on the assembler/linker and more importantly debug linker (dsymutil) from Xcode, so it’s important that the versions used there support the constructs we emit. In the meantime, I would expect that if you are using GCC on >= macOS 10.10 it would be reasonable to put -gdwarf-4 on the command lines. Before that, the support might be unreliable. thanks Iain