This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: threads/1529: turn off thread support?
- From: Peter D HUERTER <pete dot huerter at st dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 22 Apr 2004 04:28:01 -0000
- Subject: Re: threads/1529: turn off thread support?
- Reply-to: Peter D HUERTER <pete dot huerter at st dot com>
The following reply was made to PR threads/1529; it has been noted by GNATS.
From: Peter D HUERTER <pete.huerter@st.com>
To: gdb-gnats@sources.redhat.com
Cc:
Subject: Re: threads/1529: turn off thread support?
Date: Thu, 22 Apr 2004 00:18:29 -0400
A related issue:
When I try to debug a statically linked NPTL program on:
Red Hat Enterprise Linux release 2.9.5WS (Taroon)
Kernel 2.4.21-1.1931.2.393.ent on an x86_64
using:
[pete@rhel30_64 ~]$ /usr/bin/gdb examples/omp
GNU gdb Red Hat Linux (5.3.90-0.20030710.19rh)
Copyright 2003 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 "x86_64-redhat-linux-gnu"...Using host
libthread_db library "/lib64/tls/libthread_db.so.1".
GDB tries to use libthread_db.so.1 off of /lib/tls, and fails to attach
to detect the threads:
(gdb) run
Starting program: /home/pete/examples/omp
One thread ...
Warning: OMP_NUM_THREADS or NCPUS (4) greater than available cpus (1)
Program received signal SIG32, Real-time event 32.
0x0000000000403dde in __pthread_sigsuspend ()
(gdb) threads
Undefined command: "threads". Try "help".
(gdb) info thread
(gdb)
If GDB were to use /lib/libthread_db.so instead it would probably work
(since I work on a debugger that fails in this case to debug threads
using /lib/tls/libthread_db.so, but works when instead it uses
/lib/libthread_db.so.
Does anyone have any information about this behavior?
When the program is dynamically linked /lib/tls version works fine with
GDB above.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host
libthread_db library "/lib64/tls/libthread_db.so.1".
(gdb) run
Starting program: /home/pete/examples/omp
[Thread debugging using libthread_db enabled]
[New Thread 182894171728 (LWP 14938)]
One thread ...
Warning: OMP_NUM_THREADS or NCPUS (4) greater than available cpus (1)
[New Thread 1084225904 (LWP 14964)]
[New Thread 1094711664 (LWP 14965)]
[New Thread 1105197424 (LWP 14966)]
HELLO 14938, 0
HELLO 14938, 0
HELLO 14938, 2
HELLO 14938, 2
HELLO 14938, 1
HELLO 14938, 1
HELLO 14938, 3
HELLO 14938, 3
... back to one thread.
Program exited with code 030.
(gdb)
The thread IDs look a bit off, but...
Q: How is a debugger to know which version of libthread_db.so to use?