From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14618 invoked by alias); 3 Jun 2009 09:26:20 -0000 Received: (qmail 14606 invoked by uid 22791); 3 Jun 2009 09:26:18 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,OBSCURED_EMAIL,WEIRD_QUOTING X-Spam-Check-By: sourceware.org Received: from mail193.messagelabs.com (HELO mail193.messagelabs.com) (85.158.140.195) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Wed, 03 Jun 2009 09:26:10 +0000 X-VirusChecked: Checked X-Env-Sender: Noel.Vellemans@visionBMS.com X-Msg-Ref: server-11.tower-193.messagelabs.com!1244021166!24778791!1 X-StarScan-Version: 6.0.0; banners=-,-,- Received: (qmail 4412 invoked from network); 3 Jun 2009 09:26:07 -0000 Received: from gateway.loepfe.com (HELO gateway.loepfe.com) (195.134.156.204) by server-11.tower-193.messagelabs.com with SMTP; 3 Jun 2009 09:26:07 -0000 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Q: GDB - Threads Date: Wed, 03 Jun 2009 09:26:00 -0000 Message-ID: <1531E53627F1F749B4FE809BF2A4EB67FDA109@WETMEX10.loepfe.com> In-Reply-To: <20090602181723.GA11310@caradoc.them.org> References: <1531E53627F1F749B4FE809BF2A4EB67FABA56@WETMEX10.loepfe.com> <1531E53627F1F749B4FE809BF2A4EB67FD9F52@WETMEX10.loepfe.com> <8ac60eac0906020941w3064fa70l263b316358c9e38f@mail.gmail.com> <20090602181723.GA11310@caradoc.them.org> From: "Vellemans, Noel" 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: 2009-06/txt/msg00028.txt.bz2 Hi, First of all I want to thank everyone dor the responses so far.... Here it goes..... I want to mention that I have used NO STRIPING, i.o.w strip is turned off for all lib files (in fact for all files on the target, no striping is used !) On Tue, Jun 02, 2009 at 09:41:19AM -0700, Paul Pluzhnikov wrote: > > > Both libs have been build on the same system.. (buildroot).. > > > Even started from scratch.... > > > 88 -rw-r--r-- 1 noel noel 82178 2009-06-02 16:23=20 > > > libpthread-0.9.30.1.so > > > 16 -rw-r--r-- 1 noel noel 13171 2009-06-02 16:23=20 > > > libthread_db-0.9.30.1.so > >=20 > > The identical time stamp implies that these were both installed at the=20 > > same time, which means they are both built for *target*. > >=20 > > But you need an identical libthread_db built for *host*. > > Ohhh , I think this is where it goes wrong, I was not aware of this. NOTE: for the HOST !! ldd libthread_db-1.0.so=20 checking sub-depends for 'libc.so.6' libc.so.6 =3D> libc.so.6 (0x00000000) /lib/ld-linux.so.2 =3D> /lib/ld-linux.so.2 (0x00000000) for the TARGET ldd libthread_db-0.9.30.1.so=20 checking sub-depends for 'libc.so.0' libc.so.0 =3D> libc.so.0 (0x00000000) /lib/ld-uClibc.so.0 =3D> /lib/ld-uClibc.so.0 (0x00000000) SO this is WRONG...!!!=20 The question I now have is: My target is an ARM system (at91sam9g20), my host is a PC. What is the CORRECT way of getting this libfile (and dependencies) the same 'versions' on both systems! I assume taking a 'copy' of the *target*/lib/libthread_db to *host*/lib/libthread_db will not work (because the target is an ARM and the host is a PC). Some more questions remarks... (please ref to gdb verbose console log.. you might find something 'usable' in it.. ) I have set the "gdb-set solib-search-path /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib:/ target/lib" but gdb always find's the=20 'wrong ones' (because the are in *HOST*/lib...) After verbose mode I got this output in the gdbconsole. warning: .dynamic section for "/lib/libpthread.so.0" is not at the expected address (wrong library or version mismatch?) warning: .dynamic section for "/lib/libgcc_s.so.1" is not at the expected address (wrong library or version mismatch?) &"warning: .dynamic section for \"/lib/libpthread.so.0\" is not at the expected address (wrong library or version mismatch?)\n" &"warning: .dynamic section for \"/lib/libgcc_s.so.1\" is not at the expected address (wrong library or version mismatch?)\n" ~"Stopped due to shared library event\n" Stopped due to shared library event 24*stopped,thread-id=3D"1" (gdb)=20 25 info sharedlibrary &"info sharedlibrary\n" ~"From To Syms Read Shared Object Library\n" ~"0x40000930 0x40003eb0 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l d-uClibc.so.0\n" ~"0x400121b0 0x4001d628 Yes /lib/libpthread.so.0\n" =3D=3D=3D= =3D=3D=3D> BAD ONE ! <=3D=3D=3D=3D=3D=3D=3D ~"0x40029cb0 0x40032ee8 Yes /lib/libgcc_s.so.1\n" =3D=3D=3D=3D=3D=3D>IS THIS IS A BAD ONE ???? <=3D=3D=3D=3D=3D=3D=3D ~"0x40044c90 0x400855b0 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibc.so.0\n" 25^done At this time (for testing) I have deleted the "wrong" libfiles on my host, to make sure GDB finds the correct ones.:-)) And now I have this output... Stopped due to shared library event 204*stopped,thread-id=3D"1" (gdb)=20 205 info sharedlibrary &"info sharedlibrary\n" ~"From To Syms Read Shared Object Library\n" ~"0x40000930 0x40003eb0 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l d-uClibc.so.0\n" ~"0x40011cc0 0x4001820c Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibpthread.so.0\n" =3D=3D>> OK <=3D=3D ~"0x40029ca0 0x40030ec4 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibgcc_s.so.1\n" =3D=3D>> ?? BETTER ?? <=3D=3D ~"0x40044c90 0x400855b0 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibc.so.0\n" 205^done Which seems to be better ... I guess :-), but how do I fix this the normal way (without deleting) ? I have included the gdb console log , you guy's might see anything in it I'm not aware Kind regards NOEL. <<< GBD verbose conlose log... >>> 1-gdb-set confirm off 1^done (gdb)=20 2-gdb-set width 0 2^done (gdb)=20 3-gdb-set height 0 3^done (gdb)=20 4-interpreter-exec console echo 4^done (gdb)=20 5-gdb-show prompt 5^done,value=3D"(gdb) " (gdb)=20 6-gdb-set auto-solib-add on 6^done (gdb)=20 7-gdb-set stop-on-solib-events 0 7^done (gdb)=20 8-gdb-set stop-on-solib-events 1 8^done (gdb)=20 9-gdb-show solib-search-path 9^done,value=3D"" (gdb)=20 10-gdb-set solib-search-path /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib:/ target/lib 10^done (gdb)=20 11-target-select remote 150.158.204.147:9000 ~"[New Thread 912]\n" [New Thread 912] 11^connected,thread-id=3D"1",frame=3D{addr=3D"0x40000930",func=3D"_start",a= rgs=3D[ ],from=3D"/buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/ro ot/lib/ld-uClibc.so.0"} (gdb)=20 12-environment-cd /buildhome/DU7PE/software/threading 12^done (gdb)=20 13-environment-directory /buildhome/DU7PE/software/threading /buildhome/DU7PE/software/threading/sources 13^done,source-path=3D"/buildhome/DU7PE/software/threading:/buildhome/DU7P E/software/threading/sources:$cdir:$cwd" (gdb)=20 14 info threads &"info threads\n" ~"* 1 Thread 912 0x40000930 in _start () from /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l d-uClibc.so.0\n" 14^done (gdb)=20 15-data-list-register-names 15^done,register-names=3D["r0","r1","r2","r3","r4","r5","r6","r7","r8","r9 ","r10","r11","r12","sp","lr","pc","f0","f1","f2","f3","f4","f5","f6","f 7","fps","cpsr","","","","","","","","","","","","","","","","","","","" ,"","","","","","","","","","","","",""] (gdb)=20 16-stack-info-depth 16^done,depth=3D"2" (gdb)=20 17-stack-list-frames 0 2 17^done,stack=3D[frame=3D{level=3D"0",addr=3D"0x40000930",func=3D"_start",f= rom=3D"/b uildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/ld- uClibc.so.0"},frame=3D{level=3D"1",addr=3D"0x00000000",func=3D"??"}] (gdb)=20 18-break-insert -t main During symbol reading, DW_AT_name missing from DW_TAG_base_type. &"During symbol reading, DW_AT_name missing from DW_TAG_base_type.\n" 18^done,bkpt=3D{number=3D"1",type=3D"breakpoint",disp=3D"del",enabled=3D"y"= ,addr=3D" 0x00008784",func=3D"main",file=3D"sources/main.c",fullname=3D"/buildhome/DU= 7PE /software/threading/sources/main.c",line=3D"46",times=3D"0"} (gdb)=20 19-exec-continue 19^running (gdb)=20 ~"Stopped due to shared library event\n" Stopped due to shared library event 19*stopped,thread-id=3D"1" (gdb)=20 20 info sharedlibrary &"info sharedlibrary\n" ~"From To Syms Read Shared Object Library\n" ~"0x40000930 0x40003eb0 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l d-uClibc.so.0\n" ~"0x40011cc0 0x4001820c Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibpthread.so.0\n" ~"0x40029ca0 0x40030ec4 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibgcc_s.so.1\n" ~"0x40044c90 0x400855b0 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibc.so.0\n" 20^done (gdb)=20 21-exec-continue 21^running (gdb)=20 ~"Stopped due to shared library event\n" Stopped due to shared library event 21*stopped,thread-id=3D"1" (gdb)=20 22 info sharedlibrary &"info sharedlibrary\n" ~"From To Syms Read Shared Object Library\n" ~"0x40000930 0x40003eb0 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l d-uClibc.so.0\n" ~"0x40011cc0 0x4001820c Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibpthread.so.0\n" ~"0x40029ca0 0x40030ec4 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibgcc_s.so.1\n" ~"0x40044c90 0x400855b0 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibc.so.0\n" 22^done (gdb)=20 23-exec-continue 23^running (gdb)=20 23*stopped,thread-id=3D"1",frame=3D{addr=3D"0x00008784",func=3D"main",args= =3D[],fi le=3D"sources/main.c",fullname=3D"/buildhome/DU7PE/software/threading/source s/main.c",line=3D"46"} (gdb)=20 24 info threads &"info threads\n" &"During symbol reading, incomplete CFI data; unspecified registers (e.g., r0) at 0x8780.\n" ~"* 1 Thread 912 main () at sources/main.c:46\n" 24^done (gdb)=20 25-stack-info-depth 25^done,depth=3D"1" (gdb)=20 26-stack-list-frames 0 1 26^done,stack=3D[frame=3D{level=3D"0",addr=3D"0x00008784",func=3D"main",fil= e=3D"sour ces/main.c",fullname=3D"/buildhome/DU7PE/software/threading/sources/main.c ",line=3D"46"}] (gdb)=20 27-data-list-changed-registers 27^done,changed-registers=3D["0","1","2","3","4","5","6","7","8","9","10", "11","12","13","14","15","16","17","18","19","20","21","22","23","24","2 5"] (gdb)=20 28 info sharedlibrary &"info sharedlibrary\n" ~"From To Syms Read Shared Object Library\n" ~"0x40000930 0x40003eb0 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l d-uClibc.so.0\n" ~"0x40011cc0 0x4001820c Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibpthread.so.0\n" ~"0x40029ca0 0x40030ec4 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibgcc_s.so.1\n" ~"0x40044c90 0x400855b0 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibc.so.0\n" 28^done (gdb)=20 29-stack-list-arguments 0 0 0 29^done,stack-args=3D[frame=3D{level=3D"0",args=3D[]}] (gdb)=20 30-stack-list-locals 0 30^done,locals=3D[name=3D"threads",name=3D"rc",name=3D"t"] (gdb)=20 31 whatis threads &"whatis threads\n" ~"type =3D pthread_t [5]\n" 31^done (gdb)=20 32 ptype pthread_t [5] &"ptype pthread_t [5]\n" ~"type =3D long unsigned int [5]\n" 32^done (gdb)=20 33 whatis rc &"whatis rc\n" ~"type =3D int\n" 33^done (gdb)=20 34 whatis t &"whatis t\n" ~"type =3D int\n" 34^done (gdb)=20 35-var-create - * threads 35^done,name=3D"var1",numchild=3D"5",value=3D"[5]",type=3D"pthread_t [5]" (gdb)=20 36-var-create - * &(threads) 36^done,name=3D"var2",numchild=3D"1",value=3D"0xbec86d20",type=3D"pthread_t (*)[5]" (gdb)=20 37-var-set-format var2 hexadecimal 37^done,format=3D"hexadecimal",value=3D"0xbec86d20" (gdb)=20 38 ptype pthread_t (*)[5] &"ptype pthread_t (*)[5]\n" ~"type =3D long unsigned int (*)[5]\n" 38^done (gdb)=20 39-var-evaluate-expression var2 39^done,value=3D"0xbec86d20" (gdb)=20 40-var-create - * rc 40^done,name=3D"var3",numchild=3D"0",value=3D"-1094160715",type=3D"int" (gdb)=20 41-var-create - * t 41^done,name=3D"var4",numchild=3D"0",value=3D"1074339480",type=3D"int" (gdb)=20 42-var-evaluate-expression var3 42^done,value=3D"-1094160715" (gdb)=20 43-var-evaluate-expression var4 43^done,value=3D"1074339480" (gdb)=20 44-break-insert main.c:48 44^done,bkpt=3D{number=3D"2",type=3D"breakpoint",disp=3D"keep",enabled=3D"y= ",addr=3D "0x000087f8",func=3D"main",file=3D"sources/main.c",fullname=3D"/buildhome/D= U7P E/software/threading/sources/main.c",line=3D"48",times=3D"0"} (gdb)=20