This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
RE: Q: GDB - Threads
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
> > > libpthread-0.9.30.1.so
> > > 16 -rw-r--r-- 1 noel noel 13171 2009-06-02 16:23
> > > libthread_db-0.9.30.1.so
> >
> > The identical time stamp implies that these were both installed at
the
> > same time, which means they are both built for *target*.
> >
> > 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
checking sub-depends for 'libc.so.6'
libc.so.6 => libc.so.6 (0x00000000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
for the TARGET
ldd libthread_db-0.9.30.1.so
checking sub-depends for 'libc.so.0'
libc.so.0 => libc.so.0 (0x00000000)
/lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)
SO this is WRONG...!!!
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
'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="1"
(gdb)
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" ======>
BAD ONE ! <=======
~"0x40029cb0 0x40032ee8 Yes /lib/libgcc_s.so.1\n"
======>IS THIS IS A BAD ONE ???? <=======
~"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="1"
(gdb)
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" ==>> OK <==
~"0x40029ca0 0x40030ec4 Yes
/buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l
ibgcc_s.so.1\n" ==>> ?? BETTER ?? <==
~"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)
2-gdb-set width 0
2^done
(gdb)
3-gdb-set height 0
3^done
(gdb)
4-interpreter-exec console echo
4^done
(gdb)
5-gdb-show prompt
5^done,value="(gdb) "
(gdb)
6-gdb-set auto-solib-add on
6^done
(gdb)
7-gdb-set stop-on-solib-events 0
7^done
(gdb)
8-gdb-set stop-on-solib-events 1
8^done
(gdb)
9-gdb-show solib-search-path
9^done,value=""
(gdb)
10-gdb-set solib-search-path
/buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib:/
target/lib
10^done
(gdb)
11-target-select remote 150.158.204.147:9000
~"[New Thread 912]\n"
[New Thread 912]
11^connected,thread-id="1",frame={addr="0x40000930",func="_start",args=[
],from="/buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/ro
ot/lib/ld-uClibc.so.0"}
(gdb)
12-environment-cd /buildhome/DU7PE/software/threading
12^done
(gdb)
13-environment-directory /buildhome/DU7PE/software/threading
/buildhome/DU7PE/software/threading/sources
13^done,source-path="/buildhome/DU7PE/software/threading:/buildhome/DU7P
E/software/threading/sources:$cdir:$cwd"
(gdb)
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)
15-data-list-register-names
15^done,register-names=["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)
16-stack-info-depth
16^done,depth="2"
(gdb)
17-stack-list-frames 0 2
17^done,stack=[frame={level="0",addr="0x40000930",func="_start",from="/b
uildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/ld-
uClibc.so.0"},frame={level="1",addr="0x00000000",func="??"}]
(gdb)
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={number="1",type="breakpoint",disp="del",enabled="y",addr="
0x00008784",func="main",file="sources/main.c",fullname="/buildhome/DU7PE
/software/threading/sources/main.c",line="46",times="0"}
(gdb)
19-exec-continue
19^running
(gdb)
~"Stopped due to shared library event\n"
Stopped due to shared library event
19*stopped,thread-id="1"
(gdb)
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)
21-exec-continue
21^running
(gdb)
~"Stopped due to shared library event\n"
Stopped due to shared library event
21*stopped,thread-id="1"
(gdb)
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)
23-exec-continue
23^running
(gdb)
23*stopped,thread-id="1",frame={addr="0x00008784",func="main",args=[],fi
le="sources/main.c",fullname="/buildhome/DU7PE/software/threading/source
s/main.c",line="46"}
(gdb)
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)
25-stack-info-depth
25^done,depth="1"
(gdb)
26-stack-list-frames 0 1
26^done,stack=[frame={level="0",addr="0x00008784",func="main",file="sour
ces/main.c",fullname="/buildhome/DU7PE/software/threading/sources/main.c
",line="46"}]
(gdb)
27-data-list-changed-registers
27^done,changed-registers=["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)
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)
29-stack-list-arguments 0 0 0
29^done,stack-args=[frame={level="0",args=[]}]
(gdb)
30-stack-list-locals 0
30^done,locals=[name="threads",name="rc",name="t"]
(gdb)
31 whatis threads
&"whatis threads\n"
~"type = pthread_t [5]\n"
31^done
(gdb)
32 ptype pthread_t [5]
&"ptype pthread_t [5]\n"
~"type = long unsigned int [5]\n"
32^done
(gdb)
33 whatis rc
&"whatis rc\n"
~"type = int\n"
33^done
(gdb)
34 whatis t
&"whatis t\n"
~"type = int\n"
34^done
(gdb)
35-var-create - * threads
35^done,name="var1",numchild="5",value="[5]",type="pthread_t [5]"
(gdb)
36-var-create - * &(threads)
36^done,name="var2",numchild="1",value="0xbec86d20",type="pthread_t
(*)[5]"
(gdb)
37-var-set-format var2 hexadecimal
37^done,format="hexadecimal",value="0xbec86d20"
(gdb)
38 ptype pthread_t (*)[5]
&"ptype pthread_t (*)[5]\n"
~"type = long unsigned int (*)[5]\n"
38^done
(gdb)
39-var-evaluate-expression var2
39^done,value="0xbec86d20"
(gdb)
40-var-create - * rc
40^done,name="var3",numchild="0",value="-1094160715",type="int"
(gdb)
41-var-create - * t
41^done,name="var4",numchild="0",value="1074339480",type="int"
(gdb)
42-var-evaluate-expression var3
42^done,value="-1094160715"
(gdb)
43-var-evaluate-expression var4
43^done,value="1074339480"
(gdb)
44-break-insert main.c:48
44^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr=
"0x000087f8",func="main",file="sources/main.c",fullname="/buildhome/DU7P
E/software/threading/sources/main.c",line="48",times="0"}
(gdb)