This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Having problem Debugging Threads on Digital UNIX


Hello,

    One of the engineers that I support, has come to me with a problem
he is having trying to debug threads with GBD. The platform he is
working in is Compaq Tru64 UNIX. The code is all written in C++ and he
is using GCC to compile it. Here is a message that he has sent me
regarding the problem:


Here's basically what's happening with gdb.  I'm trying to debug a
multithreaded program (specifically it has 3 POSIX threads).  I set a
break
point just after two worker threads have been created.  At this point if
I
type 'info threads' I would expect to see at least 3 threads show up in
the
list of active threads (2 worker, and the main thread).  However, 'info
threads' shows only 1 process, which is the main thread.  The worker
threads
are running, as I can see their output on the screen.  But they do not
show
up in the thread list.  What's weird is that I can set break points down
in
the code which is executed by the worker threads, and I'll hit the break

points.  But the worker threads never show up in the list of know
threads.
This is a problem, as if I were really debugging a complicated program,
I
would be unable to switch between threads easily.  Gdb on a Solaris
machine,
seems to work fine and Gdb's documentation indicates it handles POSIX
threads correctly.  It just doesn't work as advertised on Digital Unix .

The threads are being created within the process. What I **think** is
happening is this: DEC Unix uses two-level scheduling, meaning user
threads
are mapped onto kernel threads for execution.  Scheduling of threads
occurs
cooperatively between the  O/S and the POSIX thread library.  We have
only 1
processor, so we have a single kernel thread for our program to execute
on.
Gdb is examining kernel threads, not our user threads, and so sees only
one
active thread.  Other programs such as Ladebug, are capable of examining
all
of the threads regardless of whether they are user or kernel threads.
Like
I said this is what I **think** is happening..


Does anyone have any suggestions ??? I really dont want to use DEC's
Ladebug when we have GDB Available.

Some more info:

SystemArchetecture: DEC Alpha
Operating System: Compaq Tru64 UNIX version 4.0f
GDB Version: 5.0
GCC Versin: 3.2


Thanks for any help or information,




--
Salvatore J. Guercio
Associate UNIX Systems Administrator
Comptek Amherst Systems Inc.
(800) 631-0610 Ext. 394
sjg@ComptekAmherst.com




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]