From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5807 invoked by alias); 19 Aug 2005 12:43:36 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 5792 invoked by uid 22791); 19 Aug 2005 12:43:32 -0000 Received: from eastrmmtao01.cox.net (HELO eastrmmtao01.cox.net) (68.230.240.38) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 19 Aug 2005 12:43:32 +0000 Received: from white ([68.9.64.121]) by eastrmmtao01.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050819124330.DUXL3468.eastrmmtao01.cox.net@white>; Fri, 19 Aug 2005 08:43:30 -0400 Received: from bob by white with local (Exim 3.36 #1 (Debian)) id 1E66Da-0004vk-00; Fri, 19 Aug 2005 08:43:30 -0400 Date: Fri, 19 Aug 2005 12:43:00 -0000 From: Bob Rossi To: Craig Jeffree Cc: gdb@sources.redhat.com Subject: Re: trouble locating source files through relative paths Message-ID: <20050819124329.GA18911@white> Mail-Followup-To: Craig Jeffree , gdb@sources.redhat.com References: <1124436292.3582.64.camel@norman> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1124436292.3582.64.camel@norman> User-Agent: Mutt/1.5.9i X-SW-Source: 2005-08/txt/msg00067.txt.bz2 > I've been having trouble getting GDB (v6.3 build myself from source on > RHEL4) to locate the source files associated with the binary I'm > debugging. The binary refers to some source files using relative paths > say for example: > > ../../include/General/GeString.H > > This file exists but the path from which the relative path should start > differs now because the binary has been moved. > > I've added the correct starting path to my source search path using the > 'dir' command and expect GDB to find the file now as described in the > GDB manual here: > http://sources.redhat.com/gdb/download/onlinedocs/gdb_8.html#SEC53 What was the 'dir' command that you issued? What compiler are you using? Do you know what debug format you are using? (stabs or dwarf)? Have you tried using the cdir command? That might work. > However an strace of GDB shows that it only looks for GeString.H in the > newly specified search path directory and doesn't ever try using the > search path as a base for the relative directories. > > If I ignore the relative path and set the search path to the full path > to this file it works, however the application has hundreds of files, > some of which have conflicting names if the directory path isn't > included. > > How can I get GDB to use the search path as a base for relative paths > specified in the debug info rather than only looking directly in the > search path dirs? I've done this before, so I know that it worked at some point. It should still work. Bob Rossi