From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8932 invoked by alias); 3 Mar 2009 01:05:02 -0000 Received: (qmail 8560 invoked by uid 22791); 3 Mar 2009 01:05:00 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Mar 2009 01:04:55 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 993F32BAB8F; Mon, 2 Mar 2009 20:04:56 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id L0WrB3Q-FAxz; Mon, 2 Mar 2009 20:04:56 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 603A72BAB86; Mon, 2 Mar 2009 20:04:56 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 4C03BE7ACD; Mon, 2 Mar 2009 17:04:51 -0800 (PST) Date: Tue, 03 Mar 2009 01:05:00 -0000 From: Joel Brobecker To: Brendan Miller Cc: gdb@sourceware.org Subject: Re: how to determine location of source? Message-ID: <20090303010451.GM3632@adacore.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i 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: 2009-03/txt/msg00012.txt.bz2 > According to documentation I read, debug binaries have the location of > the source embedded in them. How do I extract this location from the > binary? Can GDB do this? I haven't need this type of info much, but "info sources" has been handy sometimes. > Also, is there an environment variable or config file that can control > the directories that source is looked for in? There are several ways of doing this depending of what you are trying to do. There is the "dir" command. But perhaps you have moved the sources elsewhere, and want to translate the encoded source locations into your new location. Have a look at "set substitute-path". That's as much as remember off the top of my head. PS: Sounds like you could benefit greatly from reading the GDB documentation. Best advice I ever received in my first year of Engineering School. -- Joel