public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/15597] New: ignored build-id in .gnu_debugaltlink (.dwz shared file)
@ 2013-06-07 13:25 jan.kratochvil at redhat dot com
  2013-08-06 18:38 ` [Bug symtab/15597] " tromey at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jan.kratochvil at redhat dot com @ 2013-06-07 13:25 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15597

            Bug ID: 15597
           Summary: ignored build-id in .gnu_debugaltlink (.dwz shared
                    file)
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: jan.kratochvil at redhat dot com
            Target: x86_64-unknown-linux-gnu

dwarf2_get_dwz_file:

.gnu_debugaltlink contains filename, '\0', build-id.
GDB reads the filename but it does not verify if build-id matches.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug symtab/15597] ignored build-id in .gnu_debugaltlink (.dwz shared file)
  2013-06-07 13:25 [Bug symtab/15597] New: ignored build-id in .gnu_debugaltlink (.dwz shared file) jan.kratochvil at redhat dot com
@ 2013-08-06 18:38 ` tromey at redhat dot com
  2013-10-08 19:56 ` cvs-commit at gcc dot gnu.org
  2013-10-08 19:58 ` tromey at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at redhat dot com @ 2013-08-06 18:38 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15597

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at redhat dot com
           Assignee|unassigned at sourceware dot org   |tromey at redhat dot com

--- Comment #1 from Tom Tromey <tromey at redhat dot com> ---
Mine.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug symtab/15597] ignored build-id in .gnu_debugaltlink (.dwz shared file)
  2013-06-07 13:25 [Bug symtab/15597] New: ignored build-id in .gnu_debugaltlink (.dwz shared file) jan.kratochvil at redhat dot com
  2013-08-06 18:38 ` [Bug symtab/15597] " tromey at redhat dot com
@ 2013-10-08 19:56 ` cvs-commit at gcc dot gnu.org
  2013-10-08 19:58 ` tromey at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-10-08 19:56 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15597

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    tromey@sourceware.org    2013-10-08 19:56:16

Modified files:
    gdb            : ChangeLog Makefile.in dwarf2read.c elfread.c 
    gdb/testsuite  : ChangeLog 
    gdb/testsuite/lib: dwarf.exp 
Added files:
    gdb            : build-id.c build-id.h 
    gdb/testsuite/gdb.dwarf2: dwzbuildid.exp 

Log message:
    fix PR symtab/15597

    This patch fixes gdb PR symtab/15597.

    The bug is that the .gnu_debugaltlink section includes the build-id of
    the alt file, but gdb does not use it.

    This patch fixes the problem by changing gdb to do what it ought to
    always have done: verify the build id of the file found using the
    filename in .gnu_debugaltlink; and if that does not match, try to find
    the correct debug file using the build-id and debug-file-directory.

    This patch touches BFD.  Previously, gdb had its own code for parsing
    .gnu_debugaltlink; I changed it to use the BFD functions after those
    were introduced.  However, the BFD functions are incorrect -- they
    assume that .gnu_debugaltlink is formatted like .gnu_debuglink.
    However, it it is not.  Instead, it consists of a file name followed
    by the build-id -- no alignment, and the build-id is not a CRC.

    Fixing this properly is a bit of a pain.  But, because
    separate_alt_debug_file_exists just has a FIXME for the build-id case,
    I did not fix it properly.  Instead I introduced a hack.  This leaves
    BFD working just as well as it did before my patch.

    I'm willing to do something better here but I could use some guidance
    as to what.  It seems that the build-id code in BFD is largely punted
    on.

    FWIW gdb is the only user of bfd_get_alt_debug_link_info outside of
    BFD itself.

    I moved the build-id logic out of elfread.c and into a new file.
    This seemed cleanest to me.

    Writing a test case was a bit of a pain.  I added a couple new
    features to the DWARF assembler to handle this.

    Built and regtested on x86-64 Fedora 18.

    * bfd-in2.h: Rebuild.
    * opncls.c (bfd_get_alt_debug_link_info): Add buildid_len
    parameter.  Change type of buildid_out.  Update.
    (get_alt_debug_link_info_shim): New function.
    (bfd_follow_gnu_debuglink): Use it.

    * Makefile.in (SFILES): Add build-id.c.
    (HFILES_NO_SRCDIR): Add build-id.h.
    * build-id.c: New file, largely from elfread.c.  Modified
    most functions.
    * build-id.h: New file.
    * dwarf2read.c (dwarf2_get_dwz_file): Update for change to
    bfd_get_alt_debug_link_info.  Verify dwz file's build-id.
    Search for dwz file using build-id.
    * elfread.c (build_id_bfd_get, build_id_verify)
    (build_id_to_debug_filename, find_separate_debug_file): Remove.

    * gdb.dwarf2/dwzbuildid.exp: New file.
    * lib/dwarf.exp (Dwarf::_section): Add "flags" and "type"
    parameters.
    (Dwarf::_defer_output): Change "section" parameter to
    "section_spec"; update.
    (Dwarf::gnu_debugaltlink, Dwarf::_note, Dwarf::build_id): New
    procs.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/build-id.c.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/build-id.h.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.16083&r2=1.16084
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/Makefile.in.diff?cvsroot=src&r1=1.1270&r2=1.1271
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2read.c.diff?cvsroot=src&r1=1.841&r2=1.842
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/elfread.c.diff?cvsroot=src&r1=1.162&r2=1.163
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3827&r2=1.3828
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/lib/dwarf.exp.diff?cvsroot=src&r1=1.13&r2=1.14

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug symtab/15597] ignored build-id in .gnu_debugaltlink (.dwz shared file)
  2013-06-07 13:25 [Bug symtab/15597] New: ignored build-id in .gnu_debugaltlink (.dwz shared file) jan.kratochvil at redhat dot com
  2013-08-06 18:38 ` [Bug symtab/15597] " tromey at redhat dot com
  2013-10-08 19:56 ` cvs-commit at gcc dot gnu.org
@ 2013-10-08 19:58 ` tromey at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at redhat dot com @ 2013-10-08 19:58 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15597

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |7.7

--- Comment #3 from Tom Tromey <tromey at redhat dot com> ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-08 19:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-07 13:25 [Bug symtab/15597] New: ignored build-id in .gnu_debugaltlink (.dwz shared file) jan.kratochvil at redhat dot com
2013-08-06 18:38 ` [Bug symtab/15597] " tromey at redhat dot com
2013-10-08 19:56 ` cvs-commit at gcc dot gnu.org
2013-10-08 19:58 ` tromey at redhat dot com

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).