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]
Other format: [Raw text]

Re: about lin-lwp.c



> Alos in gdb/lin-lwp.c, does "multi-threads" for GNU/Linux mean
> multile LWPs (lightweight process ids), one PID (process id)?

I don't understand the question well enough to give a yes or no answer.

lin-lwp.c concerns itself with LWPs.  On GNU/Linux, an LWP is just a
process that shares its address space other LWPs.  If you obtain a
list of processes via the ``ps'' command, you'll see LWPs in addition
to pure processes (which don't share their address space).  When GDB
wants to start, stop, or interrogate an LWP it does so via the very
same facilities that are used for processes.

At the moment, on GNU/Linux, there is a one-to-one mapping between
threads and lwps.  There is a library, libthread_db.so, which is used
by GDB's thread-db.c to obtain the mapping from lwps to threads and
vice versa.

If you want to understand GDB's GNU/Linux thread support, you
must look at lin-lwp.c, thread-db.c, and proc-service.c.  (There are
some other more generic files that you'll need to look at too.)

There is a comment near the top of lin-lwp.c which suggests that
lin-lwp.c can supply support for multi-threaded applications that
don't have the support of a threads library.  To best of my knowledge,
this is not the case.  (The comment in question may have been true
at one time, or it may simply express the hopes of the author in
this regard.)

> I don't need to handle the TIDs (thread ids), do I?

I don't know.  What are you trying to do?

Kevin


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