From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23583 invoked by alias); 14 Oct 2011 15:39:06 -0000 Received: (qmail 23484 invoked by uid 22791); 14 Oct 2011 15:39:05 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_NUMERIC_HELO,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Oct 2011 15:38:49 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1REjqR-0004jA-34 for gdb@sources.redhat.com; Fri, 14 Oct 2011 17:38:47 +0200 Received: from 209.226.137.108 ([209.226.137.108]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 14 Oct 2011 17:38:47 +0200 Received: from aristovski by 209.226.137.108 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 14 Oct 2011 17:38:47 +0200 To: gdb@sources.redhat.com From: Aleksandar Ristovski Subject: Re: working with split debug files and sectionless ELFs Date: Fri, 14 Oct 2011 15:42:00 -0000 Message-ID: <4E985776.5080002@qnx.com> References: <201110121335.56792.vapier@gentoo.org> <201110141127.18567.vapier@gentoo.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Mike Frysinger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110923 Thunderbird/7.0 In-Reply-To: <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/msg00137.txt.bz2 On 11-10-14 11:27 AM, Mike Frysinger wrote: > 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 the >>> 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 >> >> Can this be used for what you want: >> >> (gdb) help set debug-file-directory > > that is already set to "/usr/lib/debug/" by default. if you look at the logic > that loads the split debug files, the issue is that it immediately returns if > no debugging information is found in the ELF -- which there isn't if all the > sections have been split out. so it doesn't get a chance to scan the debug > file directory. > > check out symfile.c:find_separate_debug_file_by_debuglink(). i hacked it locally > so that when get_debug_link_info() returns NULL, the code would fall back to > searching for the basename(argv[0]) + ".debug" of the ELF in question. that > seemed to do what i want: "just work". > -mike Ok, so the problem is that if debuglink is missing, gdb just gives up. FWIW, what you are proposing makes sense to me. Maybe make it an optional behaviour? I'd suggest you open an enhancement request in bugzilla (if there is not something along those lines there already) and propose the patch so the maintainers have a say. --- Aleksandar