From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10145 invoked by alias); 3 Aug 2005 19:15:39 -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 10111 invoked by uid 22791); 3 Aug 2005 19:15:30 -0000 Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 03 Aug 2005 19:15:30 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id j73JF99x026199; Wed, 3 Aug 2005 21:15:09 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id j73JF9Fo018871; Wed, 3 Aug 2005 21:15:09 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id j73JF4Oc008117; Wed, 3 Aug 2005 21:15:04 +0200 (CEST) Date: Wed, 03 Aug 2005 19:15:00 -0000 Message-Id: <200508031915.j73JF4Oc008117@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: pkoning@equallogic.com, gdb@sources.redhat.com In-reply-to: <20050803170618.GA12169@nevyn.them.org> (message from Daniel Jacobowitz on Wed, 3 Aug 2005 13:06:18 -0400) Subject: Re: solib search algorithm for cross-gdb References: <17136.51402.673936.895045@gargle.gargle.HOWL> <20050803170618.GA12169@nevyn.them.org> X-SW-Source: 2005-08/txt/msg00019.txt.bz2 Date: Wed, 3 Aug 2005 13:06:18 -0400 From: Daniel Jacobowitz On Wed, Aug 03, 2005 at 09:38:18AM -0400, Paul Koning wrote: > Currently, the shared library search in solib.c first tries to use the > shared lib filename as given (if solib-absolute-prefix isn't set). > > That's exactly right for a native gdb, but it is in general the wrong > answer for a cross-gdb. If I'm debugging a mips box, or analyzing a > mips corefile, resolving shared lib symbols from intel shared libs in > my /usr/lib is the wrong thing. > > .gdbinit helps, but not everyone remembers to do this right every > time. > > I was thinking about having the case of "use the filename exactly as > supplied" in solib.c be used only in native gdb. That seems to > require adding stuff in configure and config.in to tell a native from > a cross build. > > I could submit this patch if it sounds like a good feature (otherwise > I'll probably keep it as a private change). Comments? Better ways to > do this? There's an argument that this should be based primarily on the target. Using the native files is generally right for target "child"; generally wrong (though not necessarily) for target "remote"; and generally right for target "core" iff this is a native GDB. Indeed. What's important to really that even a native gdb can be used for cross-debugging. Therefore, it's probably a better idea to determine "nativeness" at run time, by comparing the architecture and OS/ABI to the system gdb is running on. Incidentally, at least for POSIX systems, it seems that we generally have a tree rooted somewhare. I think the architecture vector should describe the layout of that tree for a certain OS/ABI whereas the root of that tree would be determined by some heuristic based on the target (child, remote, core) and nativeness. Obviously for native child and core the root would be /. For remote we should probably default to whatever was specified using --with-sysroot when gdb was configured. I don't know if that's worth implementing. I'm inclined to say that your suggestion is progress, at least. Hmm. I get the feeling we have been tweaking things too much already in the past. I'd really prefer someone making a well though-out design and implementing things properly. Mark