This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfa/gdb.threads] Test static thread program
Andrew Cagney wrote:
I really really appreciate the contribution of a static thread test.
I'd like to know what specific failure mode(s) you're looking for.
GDB's thread debugging does not work on GNU/Linux when the program is linked statically.
Well yes, I guessed that much. Can you be more specific?
Bug 1328 contains all the information I know, which at present isn't
much (I'm guessing that it is missing a thread library loaded event).
I've attached a gdb.log.
Andrew
Test Run By cagney on Fri Aug 27 10:34:37 2004
Native configuration is i686-pc-linux-gnu
=== gdb tests ===
Schedule of variations:
unix
Running target unix
Using /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/../../dejagnu/baseboards/unix.exp as board description file for target.
Using /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/../../dejagnu/config/unix.exp as generic interface file for target.
Using /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/config/unix.exp as tool-and-target-specific interface file.
Running /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/gdb.threads/staticthreads.exp ...
Executing on host: gcc /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/gdb.threads/staticthreads.c -I/home/cagney/PENDING/rh-th-static/N-tourist-i686-pc-linux-gnu/gdb/testsuite -static -g -lpthreads -lm -o /home/cagney/PENDING/rh-th-static/N-tourist-i686-pc-linux-gnu/gdb/testsuite/gdb.threads/staticthreads (timeout = 300)
/usr/bin/ld: cannot find -lpthreads
collect2: ld returned 1 exit status
compiler exited with status 1
output is:
/usr/bin/ld: cannot find -lpthreads
collect2: ld returned 1 exit status
Executing on host: gcc /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/gdb.threads/staticthreads.c -I/home/cagney/PENDING/rh-th-static/N-tourist-i686-pc-linux-gnu/gdb/testsuite -static -g -lpthread -lm -o /home/cagney/PENDING/rh-th-static/N-tourist-i686-pc-linux-gnu/gdb/testsuite/gdb.threads/staticthreads (timeout = 300)
PASS: gdb.threads/staticthreads.exp: successfully compiled posix threads test case
GNU gdb 2004-08-12-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/gdb.threads
[A
(gdb) dir /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/gdb.thread[Ks
Source directories searched: /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/gdb.threads:$cdir:$cwd
(gdb) file /home/cagney/PENDING/rh-th-static/N-tourist-i686-pc-linux-gnu/gdb/tes
tsuite/gdb.threads/staticthreads
Reading symbols from /home/cagney/PENDING/rh-th-static/N-tourist-i686-pc-linux-gnu/gdb/testsuite/gdb.threads/staticthreads...done.
(gdb) set print sevenbit-strings
(gdb) PASS: gdb.threads/staticthreads.exp: set print sevenbit-strings
delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x8048254: file /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/gdb.threads/staticthreads.c, line 53.
(gdb) run
Starting program: /home/cagney/PENDING/rh-th-static/N-tourist-i686-pc-linux-gnu/gdb/testsuite/gdb.threads/staticthreads
Breakpoint 1, main (argc=1, argv=0xfef0e694) at /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/gdb.threads/staticthreads.c:53
53 pthread_attr_init (&attr);
(gdb) break sem_post
Breakpoint 2 at 0x804bf8d
(gdb) PASS: gdb.threads/staticthreads.exp: break sem_post
continue
Continuing.
Thread executing
Program received signal SIG32, Real-time event 32.
0x0804b367 in __pthread_sigsuspend ()
(gdb) KFAIL: gdb.threads/staticthreads.exp: Continue to main's call of sem_post (PRMS: gdb/1328)
run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/cagney/PENDING/rh-th-static/N-tourist-i686-pc-linux-gnu/gdb/testsuite/gdb.threads/staticthreads
Breakpoint 1, main (argc=1, argv=0xfee72504) at /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/gdb.threads/staticthreads.c:53
53 pthread_attr_init (&attr);
(gdb) PASS: gdb.threads/staticthreads.exp: rerun to main
handle SIG32 nostop noprint pass
Signal Stop Print Pass to program Description
SIG32 No No Yes Real-time event 32
(gdb) PASS: gdb.threads/staticthreads.exp: handle SIG32 nostop noprint pass
continue
Continuing.
Thread executing
Breakpoint 2, 0x0804bf8d in sem_post ()
(gdb) PASS: gdb.threads/staticthreads.exp: handle SIG32 helps
info threads
(gdb) KFAIL: gdb.threads/staticthreads.exp: info threads (PRMS: gdb/1328)
quit
The program is running. Exit anyway? (y or n) y
PASS: gdb.threads/staticthreads.exp: GDB exits with static thread program
testcase /home/cygnus/cagney/PENDING/rh-th-static/src/gdb/testsuite/gdb.threads/staticthreads.exp completed in 6 seconds
=== gdb Summary ===
# of expected passes 7
# of known failures 2
Executing on host: /home/cagney/PENDING/rh-th-static/N-tourist-i686-pc-linux-gnu/gdb/testsuite/../../gdb/gdb -nw --command gdb_cmd (timeout = 300)
GNU gdb 2004-08-12-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
/home/cagney/PENDING/rh-th-static/N-tourist-i686-pc-linux-gnu/gdb/testsuite/../../gdb/gdb version 2004-08-12-cvs -nx
runtest completed at Fri Aug 27 10:34:46 2004