From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15430 invoked by alias); 3 Sep 2007 10:30:22 -0000 Received: (qmail 14886 invoked from network); 3 Sep 2007 10:30:05 -0000 Received: from unknown (202.108.59.148) by sourceware.org with QMTP; 3 Sep 2007 10:30:05 -0000 Received: (qmail 17248 invoked from network); 3 Sep 2007 18:25:36 +0800 Received: from unknown (HELO xchen) (Authenticated?user:?xchen@sunrisetelecom.com.cn@[219.142.163.192]) (envelope-sender ) by 0 (qmail-ldap-1.03) with SMTP for ; 3 Sep 2007 18:25:36 +0800 From: "xchen" To: "'Daniel Jacobowitz'" Cc: Subject: Re: (Rising Spam Alert)Re: (Rising Spam Alert)Re: wrong lib address Date: Mon, 03 Sep 2007 10:30:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-09/txt/msg00015.txt.bz2 Message-ID: <20070903103000.COOswb-sWNbyfn9icoXalWHECHqoFEpwMjF80-gmxWU@z> =20 Hi Daniel=20 I have resolved this problem. I misunderstood the mean of solib-absolute-prefix. And now I use solib-search-path to load the library. Bad luck! New errors occured include Malformed packet(b) (missing colon) and Invalid remote reply when I continue to debug my peogram. Belowed is the snapshot (gdb) set solib-absolute-prefix /root/ (gdb) set solib-search-path /opt/montavista/pro/devkit/ppc/8xx/target/lib/:/opt/montavista/pro/devkit/pp c/8xx/target/usr/lib/ (gdb) b main Breakpoint 1 at 0x1000a5cc: file ../working/src/root.cpp, line 232. (gdb) target remote 192.168.70.99:1234 Remote debugging using 192.168.70.99:1234 _start () at ../sysdeps/powerpc/powerpc32/dl-start.S:33 33 ../sysdeps/powerpc/powerpc32/dl-start.S: No such file or directory. in ../sysdeps/powerpc/powerpc32/dl-start.S Current language: auto; currently asm (gdb) c Continuing. Ignoring packet error, continuing... [New Thread 16384] [Switching to Thread 16384] Breakpoint 1, main (argc=3D2147483016, argv=3D0xfc32da4) at ../working/src/= root. cpp:232 232 pthread_attr_init( &init_attr ); Current language: auto; currently c++ (gdb) info sharedlibrary=20 =46rom To Syms Read Shared Object Library 0x0ff940c0 0x0ff9cc84 Yes /opt/montavista/pro/devkit/ppc/8xx/target/lib/libpthread.so.0 0x0ff5fc24 0x0ff63bb4 Yes /opt/montavista/pro/devkit/ppc/8xx/target/lib/librt.so.1 0x0feb9a78 0x0ff198bc Yes /opt/montavista/pro/devkit/ppc/8xx/target/usr/lib/libstdc++.so.5 0x0fdae728 0x0fe1e998 Yes /opt/montavista/pro/devkit/ppc/8xx/target/lib/libm.so.6 0x0fd7da40 0x0fd86f3c Yes /opt/montavista/pro/devkit/ppc/8xx/target/lib/libgcc_s.so.1 0x0fc32ad0 0x0fd3a1fc Yes /opt/montavista/pro/devkit/ppc/8xx/target/lib/libc.so.6 0x30001f90 0x30013760 Yes /opt/montavista/pro/devkit/ppc/8xx/target/lib/ld.so.1 (gdb) b sysInit Breakpoint 2 at 0x1000a2c0: file ../working/src/root.cpp, line 90. (gdb) set listsize 30 (gdb) c Continuing. warning: Invalid remote reply: n8001 warning: Invalid remote reply: n4002 [New Thread 16386] [Switching to Thread 16386] (gdb) n Malformed packet(b) (missing colon): 01:30024860;40:0ff970ac; Packet: 'TR272;01:30024860;40:0ff970ac;' (gdb) n Malformed packet(b) (missing colon): 01:30024860;40:0ff970ac; Packet: 'TR273;01:30024860;40:0ff970ac;' (gdb) n Malformed packet(b) (missing colon): 01:30024860;40:0ff970ac; Packet: 'TR274;01:30024860;40:0ff970ac;' (gdb) n warning: Invalid remote reply: n8003 warning: Invalid remote reply: nc004 warning: Invalid remote reply: n10005 warning: Invalid remote reply: n14006 warning: Invalid remote reply: n18007 warning: Invalid remote reply: n1c008 warning: Invalid remote reply: n20009 warning: Invalid remote reply: n2400a warning: Invalid remote reply: n2800b warning: Invalid remote reply: n2c00c warning: Invalid remote reply: n3000d warning: Invalid remote reply: n3400e Hope your help=20 Thx, Xi -----=D3=CA=BC=FE=D4=AD=BC=FE----- =B7=A2=BC=FE=C8=CB: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.o= rg] =B4=FA=B1=ED xchen =B7=A2=CB=CD=CA=B1=BC=E4: 2007=C4=EA9=D4=C23=C8=D5 12:17 =CA=D5=BC=FE=C8=CB: 'Daniel Jacobowitz' =B3=AD=CB=CD: gdb@sourceware.org =D6=F7=CC=E2: (Rising Spam Alert)Re: (Rising Spam Alert)Re: wrong lib addre= ss =20 Hi Daniel, You said I need the libraries available in the same path for both host and target. But gdb can load ld.so.1 successfully , in fact my target doesn't have the path such as /opt/montavista/pro/devkit/ppc/8xx/target/lib, ld.so.1 was storaged in /lib for target. It means gdb load the same library use different path. Why gdb can't load other library use different path.=20 BTW /mnt/cf/shared/lib was added in the ld.so.conf for target. I guess $(CROSS_COMPILE)/lib is the default library path for montavista, in target, $(CROSS_COMPILE) is a empty string, so for gdb both /opt/montavista/pro/devkit/ppc/8xx/target/lib and /lib are equle to $(CROSS_COMPILE)/lib. But when I use echo $CROSS_COMPILE in host,=20 Last login: Mon Sep 3 10:24:10 2007 from 192.168.70.183 Have a lot of fun... metrodev:~ # echo $CROSS_COMPILE metrodev:~ # It displays empty string Could you give me directions. Thx, Xi (gdb) info sharedlibrary=20 =46rom To Syms Read Shared Object Library 0x30001f90 0x30013760 Yes /opt/montavista/pro/devkit/ppc/8xx/target/lib/ld.so.1 No /mnt/cf/shared/lib/libpthread.so.0 No /mnt/cf/shared/lib/librt.so.1 No /mnt/cf/shared/lib/libstdc++.so.5 No /mnt/cf/shared/lib/libm.so.6 0x0fd7da40 0x0fd86f3c Yes /opt/montavista/pro/devkit/ppc/8xx/target/lib/libgcc_s.so.1 0x0fc32ad0 0x0fd3a1fc Yes /opt/montavista/pro/devkit/ppc/8xx/target/lib/libc.so.6 -----=D3=CA=BC=FE=D4=AD=BC=FE----- =B7=A2=BC=FE=C8=CB: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.o= rg] =B4=FA=B1=ED Daniel Jacobowitz =B7=A2=CB=CD=CA=B1=BC=E4: 2007=C4=EA8=D4=C230=C8=D5 20:15 =CA=D5=BC=FE=C8=CB: xchen =B3=AD=CB=CD: gdb@sourceware.org =D6=F7=CC=E2: (Rising Spam Alert)Re: wrong lib address On Thu, Aug 30, 2007 at 06:21:12PM +0800, xchen wrote: > I don't know why the path changed to /mnt/cf/shared/lib, this is my=20 > target lib path. Maybe I create the related dir can solve the problem,=20 > but I am glad to know the essential reason and the related solution. That means /mnt/cf/shared is the path on your target where these libraries are found. You need the libraries available in the same path (plus sysroot) on your host that is used on your target. Try running ldd on the target instead of the cross ldd. -- Daniel Jacobowitz CodeSourcery