From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99382 invoked by alias); 7 Sep 2017 19:28:10 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 99372 invoked by uid 89); 7 Sep 2017 19:28:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Sep 2017 19:28:05 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 98F65564E0; Thu, 7 Sep 2017 15:28:03 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id KhGnOGVUnOcQ; Thu, 7 Sep 2017 15:28:03 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 715B7564DA; Thu, 7 Sep 2017 15:28:02 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id DED1389FA5; Thu, 7 Sep 2017 12:28:00 -0700 (PDT) Date: Thu, 07 Sep 2017 19:28:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: gdb@sourceware.org Subject: Re: GDB and -gdwarf-5 Message-ID: <20170907192800.tkbi3hm34bvbp6go@adacore.com> References: <83inguz5cz.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83inguz5cz.fsf@gnu.org> User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2017-09/txt/msg00019.txt.bz2 > I have GCC 6.3.0 installed, and it seems to support DWARF2 version 5 > via the -gdwarf-5 switch. But I wanted to make sure I really get that > version of debug info, so I tried "info source" in GDB. But that > command doesn't tell the version of DWARF2. Is there a GDB command > which does? > > I also tried "objdump --dwarf=info" (Binutils 2.29), but that says the > DWARF2 version is 4. So now I'm confused. > > Can someone please tell me how to verify the version of DWARF2 I get > with that GCC switch? I would compile a unit, and then dump the DWARF info using objdump or readelf. The beginning of that section includes the DWARF version number. Alternatively, compile with -save-temps -dA, and look at the assembly file instead. -dA annotates the directives used to produce the DWARF, and should also make it easy to verify the version number. -- Joel