Bug 1482892 - gdb: Backport fixes for code built with clang and -gsplit-dwarf
Summary: gdb: Backport fixes for code built with clang and -gsplit-dwarf
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 26
Hardware: All
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Kratochvil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-18 10:22 UTC by Raphael Kubo da Costa
Modified: 2020-12-14 09:35 UTC (History)
7 users (show)

Fixed In Version: gdb-8.0-22.fc26
Clone Of:
Environment:
Last Closed: 2017-08-24 03:51:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Sourceware 20899 0 None None None 2017-08-18 10:22:21 UTC

Description Raphael Kubo da Costa 2017-08-18 10:22:21 UTC
Since GDB 7.11 and commit http://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=7d45c7c3f692d93c3a33a043c347f1386681deb4, GDB has been unable to properly read debug information from code built with clang and -gsplit-dwarf.

This was originally affecting Chromium debug builds, as reported here: https://bugs.chromium.org/p/chromium/issues/detail?id=680654. As described there, one can reproduce the issue by building the following snippet:

  namespace N {
    int func() {
      return 42;
    }
  }

$ clang++ -gsplit-dwarf -g2 -c func.cc && clang++ -shared -o libfunc.so func.o
$ gdb -q ./libfunc.so
Reading symbols from ./libfoo.so...done.
(gdb) info func func
All functions matching regular expression "func":
File bla.cc:
int (anonymous namespace)::func();

When GCC is used, or when clang is invoked without -gsplit-dwarf, everything works as expected and "info func func" shows "int N::func();".

The bug was recently fixed in GDB upstream, but it's currently only in its master branch. It would be great if the Fedora package was updated with the following two commits:
- https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=16eb6b2db49e6cf2fdca56efd37689fcc170cd37 ("Fix dwarf2_string_attr for -gsplit-dwarf")
- https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=b33404388e5bbd8a1fddfde73cd4593ae2b557e8 ("gdb: Fix build failure with GCC 7", which is a follow-up to the previous one)

Comment 1 Fedora Update System 2017-08-18 12:59:08 UTC
gdb-8.0-22.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4fd5ba777b

Comment 2 Fedora Update System 2017-08-22 18:05:57 UTC
gdb-8.0-22.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4fd5ba777b

Comment 3 Fedora Update System 2017-08-24 03:51:16 UTC
gdb-8.0-22.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 4 Jan Kratochvil 2017-10-27 21:05:30 UTC
*** Bug 1507150 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.