From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32476 invoked by alias); 14 Oct 2011 17:31:06 -0000 Received: (qmail 32467 invoked by uid 22791); 14 Oct 2011 17:31: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 17:30:46 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RElan-00040M-4m for gdb@sources.redhat.com; Fri, 14 Oct 2011 19:30:45 +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 19:30:45 +0200 Received: from aristovski by 209.226.137.108 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 14 Oct 2011 19:30:45 +0200 To: gdb@sources.redhat.com From: Aleksandar Ristovski Subject: Re: working with split debug files and sectionless ELFs Date: Fri, 14 Oct 2011 17:34:00 -0000 Message-ID: <4E9871B9.8080901@qnx.com> References: <201110121335.56792.vapier@gentoo.org> <4E985776.5080002@qnx.com> <20111014154924.GA30442@host1.jankratochvil.net> <201110141307.54843.vapier@gentoo.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jan Kratochvil User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110923 Thunderbird/7.0 In-Reply-To: <201110141307.54843.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/msg00153.txt.bz2 On 11-10-14 01:07 PM, Mike Frysinger wrote: > On Friday 14 October 2011 11:49:24 Jan Kratochvil wrote: >> On Fri, 14 Oct 2011 17:38:30 +0200, Aleksandar Ristovski wrote: >>> On 11-10-14 11:27 AM, Mike Frysinger wrote: >>>> 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". >>> >>> 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? >> >> The problem is the ".debug" extension is stored in .debug_link and it is >> not assumed by GDB so far. And for example Debian does not use it at all. > > that's why it was a hack. i think it reasonable that if there is no debug > info to first look for the file name itself, and then look for the file name with > a .debug suffix. > > so `gdb prog` where prog is found at /usr/bin/prog would default to > /usr/lib/debug/usr/bin/prog followed by /usr/lib/debug/usr/bin/prog.debug (and > obviously /usr/lib/debug/ is the existing configurable setup and not a > hardcoded path). > > i'm thinking of the fallback/default behavior here. none of this would > preclude the existing explicit options that gdb has available. > -mike I would prefer to not have gdb assume any suffix. When I said your proposal made sense, I did not go into the implementation details. I agree this would be useful in principle - but would strongly suggest not to hard-code such a suffix, fallback or not. If suffix is desired, than at a minimum make it optional. Something like (gdb) set debug-file-suffix .debug You can make default settable at configure time. If separate info is in a separate directory, suffix quite possibly is not needed at all; it does make a lot of sense if symbol file is in the same directory as the binary itself. Further, it might not be .debug at all (e.g. we prefer using .sym). --- Aleksandar