From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10011 invoked by alias); 14 Oct 2011 15:27:37 -0000 Received: (qmail 9994 invoked by uid 22791); 14 Oct 2011 15:27:36 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Oct 2011 15:27:20 +0000 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 9D073641F7; Fri, 14 Oct 2011 15:27:19 +0000 (UTC) From: Mike Frysinger To: gdb@sourceware.org Subject: Re: working with split debug files and sectionless ELFs Date: Fri, 14 Oct 2011 15:27:00 -0000 User-Agent: KMail/1.13.7 (Linux/3.1.0-rc4; KDE/4.6.5; x86_64; ; ) Cc: Aleksandar Ristovski , gdb@sources.redhat.com References: <201110121335.56792.vapier@gentoo.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2839086.2rxUHkl8LU"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-ID: <201110141127.18567.vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00133.txt.bz2 Message-ID: <20111014152700.UYACGZxgJK38X15j5B0HdQ74CDgmEeD07-vX-fsA9Ds@z> --nextPart2839086.2rxUHkl8LU Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 1259 On Friday 14 October 2011 10:23:04 Aleksandar Ristovski wrote: > On 11-10-12 01:35 PM, Mike Frysinger wrote: > > second, i wonder if we can't have this work more intelligently out of t= he > > box. is it unreasonable to have gdb automatically search /usr/lib/debug/ > > for split debuf files if the .gnu_debuglink section does not exist ? or > > at least do it if the ELF has no sections at all ? it'd be nice if we > > could do `gdb prog` and gdb is smart enough to at least check > > /usr/lib/debug/usr/bin/prog.debug. -mike >=20 > Can this be used for what you want: >=20 > (gdb) help set debug-file-directory that is already set to "/usr/lib/debug/" by default. if you look at the lo= gic=20 that loads the split debug files, the issue is that it immediately returns = if=20 no debugging information is found in the ELF -- which there isn't if all th= e=20 sections have been split out. so it doesn't get a chance to scan the debug= =20 file directory. check out symfile.c:find_separate_debug_file_by_debuglink(). i hacked it l= ocally=20 so that when get_debug_link_info() returns NULL, the code would fall back t= o=20 searching for the basename(argv[0]) + ".debug" of the ELF in question. tha= t=20 seemed to do what i want: "just work". -mike --nextPart2839086.2rxUHkl8LU Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. Content-length: 836 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABAgAGBQJOmFTWAAoJEEFjO5/oN/WBiN4P/ifJqlyZifiCvTjv1ACu7oZE Vlg0zhI67pbh+m5fVDwS4RlewTEzrbzHsbb5aa3Eqw6HoLxcXgQ5nRb1+W9r5hI+ TkbQ6nQUhYVbk8B3JB0ywOdUyAX6/mGGSTf8bWOiStBRw6kgLIXzE8OlqsaHl37Q e7TgjzQAD65ZmKcIqKTLJ8Rc7btJ2u+3JkQqRZPOFMGBlxjoKB7nG4pR3Ph8Erho wyFTNkWDO2RX0LPT9XOt2DgQGmLqGXbvm0cJlJVdhjCtnBkDXe1g/we/h8PCYc2q 8jQdUd6h2hEOHHKqIouUUHqeHtcEy2bLzS3V96I+D2hn/FoxsfslhPpeqVumjLD5 sHrG54Cn6lyGTVq/La4J7V9RyBHYtqi5ZvSCzFUjrlaXA7jEcdkR1Z5OB73QwANE G+IsD34Pb/IeKzZu7dNLFryO2qkPNYiVosJGfDIh+/yT7kwgiEeE/EA8CJ1hUZRL pjaOvGO7laVnO0l0zJMinFePA4To8spKtlWGA8nDRcFzKubFjuzNW8xFkx3ce2cz SG/Kqxdx8++b/PbIdiQY+X8PmOV586X0529XCzfZb4tEuok+m2ezm21Xpbh1IsVt KynnD2gpZveOWklRholYF3A4ATS9R6l/7xPgmOFi15MoQO/PMd+nrzGeSiFGo2xf QOKAiLVLqJfXwkeNAyRd =9blb -----END PGP SIGNATURE----- --nextPart2839086.2rxUHkl8LU--