public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: David Blaikie <dblaikie@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Mark Wielaard <mark@klomp.org>,
	gdb@sourceware.org,  Eric Christopher <echristo@gmail.com>
Subject: Re: DWARF5 and .gdb_index/.debug_names
Date: Mon, 31 Aug 2020 20:07:19 -0700	[thread overview]
Message-ID: <CAENS6Eub6m-ykHhtM=-_uH=ekiwA4M_9gbqiEPvu=W3PTg26xw@mail.gmail.com> (raw)
In-Reply-To: <20200831082826.GA2164630@host1.jankratochvil.net>

On Mon, Aug 31, 2020 at 1:29 AM Jan Kratochvil via Gdb <gdb@sourceware.org>
wrote:

> On Sun, 30 Aug 2020 19:18:51 +0200, Mark Wielaard wrote:
> > During the BoF Pedro mentioned that the GDB DWARF5 .debug_names support
> > is incomplete/wrong. I was wondering whether there was a good
> > description of the issue and/or a bug report for it. When using the
> > contrib/gdb-add-index.sh it does add a .gdb_index for objects
> > containing DWARF5 and the results seem correct, gdb also seems to be
> > able to use it. When adding -dwarf-5 it seems to output a .debug_names
> > section which can be read by binutils readelf (elfutils doesn't yet
> > support .debug_names). I couldn't immediately see in what way it was
> > wrong/incomplete.
>
> .debug_names from GDB needs to produce also DW_IDX_die_offset to make it
> consumable by debuggers with reasonable performance.
>
> Then I see clang++ -gdwarf-5 -gpubnames produces C++ names mangled while
> GDB
> produces them unmangled. I haven't found anything in DWARF-5 standard
> suggesting either.


DWARFv5, Page 137 lists the things that must be in the debug_names table,
including:

"If a subprogram or inlined subroutine is included, and has a
DW_AT_linkage_name attribute, there will be an additional index entry for
the linkage name."

It's really important that all the producers ensure the names present are
the same/at least what is in the spec, otherwise we can easily erode trust
in the name table and consumers may end up having to ignore it to ensure
correctness.


> Given mangled->unmangled mapping is possible but
> unmangled->mangled is not (such as variants of ctors/dtors) I find the
> clang
> way should be followed.
>
>
> Jan
>

  reply	other threads:[~2020-09-01  3:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-30 17:18 Mark Wielaard
2020-08-31  7:21 ` Tom de Vries
2020-08-31  8:28 ` Jan Kratochvil
2020-09-01  3:07   ` David Blaikie [this message]
2020-09-01 18:38 ` Tom Tromey
2020-09-01 18:53   ` David Blaikie
2020-09-01 19:16 ` Pedro Alves
2020-09-01 22:00   ` Eric Christopher
2020-09-14 15:23 ` Gaius Mulley

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='CAENS6Eub6m-ykHhtM=-_uH=ekiwA4M_9gbqiEPvu=W3PTg26xw@mail.gmail.com' \
    --to=dblaikie@gmail.com \
    --cc=echristo@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=mark@klomp.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).