From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30273 invoked by alias); 12 Aug 2002 03:25:11 -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 30260 invoked from network); 12 Aug 2002 03:25:10 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 12 Aug 2002 03:25:10 -0000 Received: from dsl093-061-169.pit1.dsl.speakeasy.net ([66.93.61.169] helo=nevyn.them.org ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17e5pO-0006c7-00; Sun, 11 Aug 2002 22:25:10 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17e5pf-00012P-00; Sun, 11 Aug 2002 23:25:27 -0400 Date: Sun, 11 Aug 2002 20:25:00 -0000 From: Daniel Jacobowitz To: Kevin Buettner Cc: jorma.laaksonen@hut.fi, gdb-gnats@sources.redhat.com, gdb@sources.redhat.com Subject: Re: gdb/633: fully qualified pathnames in solib_map_sections() and remote debugging Message-ID: <20020812032527.GA3838@nevyn.them.org> Mail-Followup-To: Kevin Buettner , jorma.laaksonen@hut.fi, gdb-gnats@sources.redhat.com, gdb@sources.redhat.com References: <20020806100634.11483.qmail@sources.redhat.com> <20020806132047.GA16450@nevyn.them.org> <1020809231206.ZM11775@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1020809231206.ZM11775@localhost.localdomain> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-08/txt/msg00090.txt.bz2 On Fri, Aug 09, 2002 at 04:12:06PM -0700, Kevin Buettner wrote: > On Aug 6, 9:20am, Daniel Jacobowitz wrote: > > > Global variable SOLIB_ABSOLUTE_PREFIX is used as a prefix directory > > to search for shared libraries if they have an absolute path. > > > > Global variable SOLIB_SEARCH_PATH is used as a prefix directory > > (or set of directories, as in LD_LIBRARY_PATH) to search for all > > shared libraries if not found in SOLIB_ABSOLUTE_PREFIX. > > > > Search order: > > * If path is absolute, look in SOLIB_ABSOLUTE_PREFIX. > > * If path is absolute or relative, look for it literally (unmodified). > > * Look in SOLIB_SEARCH_PATH. > > * Look in inferior's $PATH. > > * Look in inferior's $LD_LIBRARY_PATH. > > > > > > I think the search order needs some revision though: > > - A cross debugger should not search $PATH or $LD_LIBRARY_PATH > > I agree with this. > > > - A cross debugger may, or may not, want to look for the unmodified > > path; I suspect that we only want to look for unmodified relative > > paths, not unmodified absolute ones. > > I agree regarding absolute paths. > > For relative paths, I'm not convinced that it's all that useful to > look at the unmodified path. (Doing so requires that you have your > cwd set correctly, right?) Yes; I think that's not too unreasonable, though. I can go either way on this one; I believe it never comes up in GNU/Linux since the linker fills in the full path in the link map. Not 100% sure of that, however. > > With those changes you would have to explicitly specify the path to > > DSOs in a cross debugger via solib-absolute-prefix and > > solib-search-path, > > I think this would be good... > > > and GDB would stop picking up the host libpthread.so > > and making gdbserver segfault... > > ...and this too! This leaves only the question of "how". I don't want to change the behavior for a native debugger using the remote protocol; just for non-native debuggers. How should I check for this? Using configury to do it seems contrary to the direction gdbarch is going (i.e. a both native and cross debugger in one binary). -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer