From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id CBCA13850426 for ; Sun, 7 Mar 2021 16:07:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CBCA13850426 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-493-fo8bv66IM7G9G8rB2TlnPQ-1; Sun, 07 Mar 2021 11:07:28 -0500 X-MC-Unique: fo8bv66IM7G9G8rB2TlnPQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5CF0818957E7; Sun, 7 Mar 2021 16:07:27 +0000 (UTC) Received: from localhost (unknown [10.33.37.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id E680A10013D7; Sun, 7 Mar 2021 16:07:25 +0000 (UTC) Date: Sun, 7 Mar 2021 16:07:25 +0000 From: Jonathan Wakely To: Iain Sandoe Cc: Jonathan Wakely , Philippe Blain , libstdc++ Subject: Re: DWARF debug info version on macOS and 'std::' namespace (and pretty-printers) Message-ID: References: <20210305181946.GY3008@redhat.com> <604ee4a4-7936-6d4e-f062-137b2c884d36@gmail.com> MIME-Version: 1.0 In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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: 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: Sun, 07 Mar 2021 16:07:32 -0000 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...) >> >>Yes, seems likely to be a GCC problem. > >(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) > >Notes > > * Darwin defaults to dwarf-2 and also strict-dwarf. > * dwarfdump —verify does not report any issues for the object files produced by the example command lines below. > >So that [on Darwin16 / macOS 10.12] >g++ /source/test/cxx/debug-vect.C -save-temps -o t -g > >=> > >(lldb) p array >(vector >) $0 = { > _Vector_base > = { > _M_impl = { > _Vector_impl_data = { > _M_start = 0x0000000100501f40 > _M_finish = 0x0000000100501f60 > _M_end_of_storage = 0x0000000100501f60 > } > } > } >} > >but >g++ /source/test/cxx/debug-vect.C -save-temps -o t -g >-gno-strict-dwarf -gdwarf-2 > >(lldb) p array >(std::vector >) $0 = size=4 { > [0] = 0 > [1] = 0 > [2] = 0 > [3] = 0 >} > >===== > >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.