Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb@sourceware.org
Subject: Re: GDB and -gdwarf-5
Date: Thu, 07 Sep 2017 19:28:00 -0000	[thread overview]
Message-ID: <20170907192800.tkbi3hm34bvbp6go@adacore.com> (raw)
In-Reply-To: <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


  parent reply	other threads:[~2017-09-07 19:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 19:16 Eli Zaretskii
2017-09-07 19:24 ` Jan Kratochvil
2017-09-07 20:16   ` Eli Zaretskii
2017-09-07 19:28 ` Joel Brobecker [this message]
2017-09-07 20:18   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170907192800.tkbi3hm34bvbp6go@adacore.com \
    --to=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox