From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5071 invoked by alias); 1 Sep 2007 13:12:25 -0000 Received: (qmail 5062 invoked by uid 22791); 1 Sep 2007 13:12:24 -0000 X-Spam-Check-By: sourceware.org Received: from pauline.vellum.cz (HELO pauline.vellum.cz) (89.250.243.234) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 01 Sep 2007 13:12:20 +0000 Received: from host0.dyn.jankratochvil.net (localhost.localdomain [127.0.0.1]) by pauline.vellum.cz (8.12.11.20060308/8.12.11) with ESMTP id l81DCFmD005214; Sat, 1 Sep 2007 15:12:15 +0200 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.1/8.13.8) with ESMTP id l81DCDPi032736; Sat, 1 Sep 2007 15:12:13 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.1/8.14.1/Submit) id l81DCCVH032734; Sat, 1 Sep 2007 15:12:12 +0200 Date: Sat, 01 Sep 2007 13:12:00 -0000 From: Jan Kratochvil To: Eli Zaretskii Cc: gdb-patches@sourceware.org, roland@redhat.com Subject: Re: [patch] build-id .debug files load (like .gnu_debuglink) Message-ID: <20070901131212.GA32719@host0.dyn.jankratochvil.net> References: <20070824180450.GA4216@host0.dyn.jankratochvil.net> <20070824182028.GA19512@caradoc.them.org> <20070825224914.GA11255@host0.dyn.jankratochvil.net> <20070825235805.GA11876@caradoc.them.org> <20070826094053.GA31348@host0.dyn.jankratochvil.net> <20070901081934.GA31205@host0.dyn.jankratochvil.net> <20070901113530.GA30667@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.14 (2007-02-12) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-09/txt/msg00005.txt.bz2 --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 353 On Sat, 01 Sep 2007 14:15:07 +0200, Eli Zaretskii wrote: ... > But the first command, the one to create the separate debug info file, > is still needed, right? > > In any case, we should tell that these commands (or at least the last > one) is only needed for the debug-link method. Enhanced the section I hope according to your advice. Thanks, Jan --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="gdb-build-id-news-and-build2.patch" Content-length: 3636 2007-09-01 Jan Kratochvil * NEWS: Mention the build-id .debug files verification. 2007-09-01 Jan Kratochvil * gdb.texinfo (Separate Debug Files): Cosmetic quoting removal. Fixed the ``build ID'' name. New binaries build instructions for the build ID inclusion. Explain how the commands are specific to the build ID vs. debug link. --- gdb/NEWS 28 Aug 2007 19:57:11 -0000 1.236 +++ gdb/NEWS 1 Sep 2007 13:06:23 -0000 @@ -61,6 +61,9 @@ Windows and SymbianOS). * The GDB remote stub, gdbserver, now supports dynamic link libraries (DLLs) on Windows and Windows CE targets. +* GDB now supports a faster verification that a .debug file matches its binary +according to its build-id signature, if the signature is present. + * New commands set remoteflow --- gdb/doc/gdb.texinfo 1 Sep 2007 10:28:25 -0000 1.426 +++ gdb/doc/gdb.texinfo 1 Sep 2007 13:06:32 -0000 @@ -11925,7 +11925,7 @@ only on some operating systems, notably details about this feature, see @uref{http://fedoraproject.org/wiki/Releases/FeatureBuildId, the Fedora Project's description of the buid ID feature}.) The debug info -file's name is not specified explicitly by the debug ID, but can be +file's name is not specified explicitly by the build ID, but can be computed from the build ID, see below. @end itemize @@ -11941,10 +11941,10 @@ directory, in a subdirectory whose name directories of the executable's absolute file name. @item -For the ``debug ID'' method, @value{GDBN} looks in the +For the ``build ID'' method, @value{GDBN} looks in the @file{.build-id} subdirectory of the global debug directory for a file named @file{@var{nn}/@var{nnnnnnnn}.debug}, where @var{nn} are the -first 2 hex characters of the debug ID signature, and @var{nnnnnnnn} +first 2 hex characters of the build ID signature, and @var{nnnnnnnn} are the rest of the signature. (Real signatures are 32 or more characters, not 10.) @end itemize @@ -12033,16 +12033,36 @@ following commands: @smallexample @kbd{objcopy --only-keep-debug foo foo.debug} @kbd{strip -g foo} -@kbd{objcopy --add-gnu-debuglink="foo.debug" "foo"} @end smallexample @noindent These commands remove the debugging -information from the executable file @file{foo}, place it in the file -@file{foo.debug}, and leave behind a debug link in @file{foo}. Ulrich -Drepper's @file{elfutils} package, starting with version 0.53, contains +information from the executable file @file{foo} and place it in the file +@file{foo.debug}. You can use the first, second or both methods to link the +two files: + +@itemize @bullet +@item +The debug link method needs the following additional command to also leave +behind a debug link in @file{foo}: + +@smallexample +@kbd{objcopy --add-gnu-debuglink=foo.debug foo} +@end smallexample + +Ulrich Drepper's @file{elfutils} package, starting with version 0.53, contains a version of the @code{strip} command such that the command @kbd{strip foo -f -foo.debug} has the same functionality as the three commands above. +foo.debug} has the same functionality as the two separating commands and the +one linking command above. + +@item +Build ID gets embedded into the main executable using @code{ld --build-id} or +the @value{NGCC} counterpart @code{gcc -Wl,--build-id}. Build ID support plus +compatibility fixes for debug files separation are present in @sc{gnu} binary +utilities (Binutils) since version 2.17.50.0.18. +@end itemize + +@noindent Since there are many different ways to compute CRC's for the debug link (different polynomials, reversals, byte ordering, etc.), the --cWoXeonUoKmBZSoM--