From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18127 invoked by alias); 8 Jul 2009 15:07:32 -0000 Received: (qmail 18116 invoked by uid 22791); 8 Jul 2009 15:07:31 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Jul 2009 15:07:25 +0000 Received: (qmail 20567 invoked from network); 8 Jul 2009 15:07:19 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Jul 2009 15:07:19 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: How to fix solib path name? Date: Wed, 08 Jul 2009 15:07:00 -0000 User-Agent: KMail/1.9.10 Cc: danny.backx@scarlet.be References: <1247063678.3870.59.camel@pavilion> <200907081556.09821.pedro@codesourcery.com> In-Reply-To: <200907081556.09821.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200907081607.22830.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00252.txt.bz2 On Wednesday 08 July 2009 15:56:09, Pedro Alves wrote: > On Wednesday 08 July 2009 15:34:38, Danny Backx wrote: > > I'm preparing a gdb patch so it works in a cross-debugging environment. > > Host I'm using is a linux pc, target is running Windows CE Embedded 6.0. > >=20 > > The gdbserver part is getting complete, see other messages on this list. > >=20 > > The gdb still has a quirck or two. > >=20 > > (gdb) info sharedlibrary > > >From To Syms Read Shared Object Library > > No \network\x86\libgcc_s_sjlj-1.dll > > 0x41ee1000 0x41fb2974 > > Yes /opt/x86mingw32ce/i386-mingw32ce/lib/libstdc++-6.dll > > No \Windows\coredll.dll > > (gdb)=20 > >=20 > > I'm guessing that it should strip the \network\x86 from the library name > > before it attempts to find it in the solib-search-path. > >=20 >=20 > Interesting. Does this mean that CE6 always reports absolute path > names in dll events? If so, you want to use "set sysroot", not > "set solib-search-path". >=20 > (gdb) help set sysroot > Set an alternate system root. > The system root is used to load absolute shared library symbol files. > For other (relative) files, you can add directories using > `set solib-search-path'. >=20 > You'll have to issue with backslashes on linux though. I don't > remember if GDB head takes care of converting those to forward > slashes for you or not. >=20 >=20 > Here's what I see when debugging gdbserver with > itself on ARM CE 5.0 Pocket PC: >=20 > WinMainCRTStartup (hInst=3D0xf65999ae, hPrevInst=3D0x0, lpCmdLine=3D0x261= 3fed8 L"", nCmdShow=3D5) > at /home/pedro/cegcc/trunk/cegcc/src/mingw/crt3.c:35 > 35 { > (gdb) info sharedlibrary > From To Syms Read Shared Object Library > No ws2.dll > No coredll.dll.0409.mui > No coredll.dll > (gdb)=20=20 >=20 > That is, CE reports relative paths, at least for system dlls. I'm yet > refresh my memory what happens against a non-system dll. >=20 Okay, just confirmed it. It's the same with non-system dlls. All reported paths are relative. Here shreloc2.s and shreloc1.sl are both under /tmp, as well as shreloc, the main application. (this is a test from gdb's testsuite). (gdb) info sharedlibrary =46rom To Syms Read Shared Object Library No shreloc2.sl No shreloc1.sl No coredll.dll.0409.mui No coredll.dll (gdb)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 So, CE6 behaves differently to CE 5 and lower here. I'm not that surprised, since the memory model on CE6 was completely revamped to eliminate the 32MB restrictions. Maybe we can make gdbserver smarter even on CE < 6? I think I remember that if you had toolhelp.dll on the device, you'd get absolute paths, but I'm not sure if that's a valid memory I have. --=20 Pedro Alves