From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1740 invoked by alias); 6 Aug 2002 13:20:34 -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 1718 invoked from network); 6 Aug 2002 13:20:33 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 6 Aug 2002 13:20:33 -0000 Received: from dsl254-114-118.nyc1.dsl.speakeasy.net ([216.254.114.118] helo=nevyn.them.org ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17c4GH-0003H0-00; Tue, 06 Aug 2002 08:20:34 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17c4GV-0005EH-00; Tue, 06 Aug 2002 09:20:47 -0400 Date: Tue, 06 Aug 2002 06:20:00 -0000 From: Daniel Jacobowitz To: jorma.laaksonen@hut.fi Cc: 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: <20020806132047.GA16450@nevyn.them.org> Mail-Followup-To: jorma.laaksonen@hut.fi, gdb-gnats@sources.redhat.com, gdb@sources.redhat.com References: <20020806100634.11483.qmail@sources.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020806100634.11483.qmail@sources.redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-08/txt/msg00028.txt.bz2 On Tue, Aug 06, 2002 at 10:06:34AM -0000, jorma.laaksonen@hut.fi wrote: > > >Number: 633 > >Category: gdb > >Synopsis: fully qualified pathnames in solib_map_sections() and remote debugging > >Confidential: no > >Severity: non-critical > >Priority: medium > >Responsible: unassigned > >State: open > >Class: sw-bug > >Submitter-Id: net > >Arrival-Date: Tue Aug 06 03:08:01 PDT 2002 > >Closed-Date: > >Last-Modified: > >Originator: jorma.laaksonen@hut.fi > >Release: gdb-5.2 > >Organization: > >Environment: > --host=i686-pc-linux-gnu --target=arm-linux > >Description: > When debugging remotely an application that runs > in another type of platform, solib_map_sections() of solib.c gets called with fully qualified pathnames > that are correct in the target system but not necessarily > in the host system. Or, the host system's solib versions > are of incorrect file format for the cross-target gdb. > > When such a solib doesn't exist in host's filesystem, > a loop of errors like > > > Error while mapping shared library sections: > > /usr/lib/libxxx.so.1: No such file or directory. > > is entered. > >How-To-Repeat: > > >Fix: > Add a variable that specifies search path for solibs > while debugging remotely ??? There already is one :) Two in fact. The normal solution to this is to set solib-absolute-prefix to point at an image of the target filesystem. GLOBAL FUNCTION solib_open -- Find a shared library file and open it. SYNOPSIS int solib_open (char *in_patname, char **found_pathname); DESCRIPTION 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 - 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. 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, and GDB would stop picking up the host libpthread.so and making gdbserver segfault... any comments from the list? -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer