This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB and -gdwarf-5
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb at sourceware dot org
- Date: Thu, 7 Sep 2017 12:28:00 -0700
- Subject: Re: GDB and -gdwarf-5
- Authentication-results: sourceware.org; auth=none
- References: <83inguz5cz.fsf@gnu.org>
> 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