Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@science.uva.nl>
To: "H . J . Lu" <hjl@lucon.org>
Cc: GDB <gdb@sourceware.cygnus.com>
Subject: Re: Is the current gdb 5.1 broken for Linuxthreads?
Date: Wed, 19 Sep 2001 06:56:00 -0000	[thread overview]
Message-ID: <s3ik7yvqobd.fsf@soliton.wins.uva.nl> (raw)
In-Reply-To: <20010918135555.A12648@lucon.org>

"H . J . Lu" <hjl@lucon.org> writes:

> It seems that the Linuxthreads support in gdb 5.1 is very fragile. In
> some aspects, it is worse than gdb 4.17/4.18 with various Linuxthreads
> patches. The problem seems to be gdb starts with the none-threaded mode
> and the Linuxthreads support is only activated at very late time. In
> some cases, it is too late. One problem seems to call wait () on cloned
> processes. Can't we treat none-threaded Linux procceses as a
> Linuxthreads with one thread? That is what gdb 4.17 does.

And in some sense the threads support in GDB 5.1 is better than GDB
4.17/4.18 with patches.  The 4.17/4.18 Linuxthreads-patches are
unmaintainable.  Whenever the internals of the threads library change
you'll need to patch GDB.  They also make it very hard to add support
for other threads libraries to GDB.

Not activating the LinuxThreads support until the threads library is
detected by GDB still seems the right approach to me.  The
LinuxThreads support has to do certain things that interfere with the
process being debugged, and you don't want that for non-threaded
processes.  That said, I think it should be possible to make the LWP
layer in lin-lwp.c (which is largely threads library independent) the
default layer for Linux without any unwanted side-effects.  At least
for 2.4 kernels.

BTW, debugging threaded apps under Linux will always be somewhat
fragile as long as there isn't a sane kernel threads interface to the
kernel.  There should be an interface to stop all threads in a
synchronous way.  Unfortunately, I have no hope that such an interface
will be added to the kernel.

> BTW, people may be very disappointed at the current Linuxthreads
> support in gdb 5.1.

If they are they should help improving it.  Several people have
reported problems.  Most of these I have been unable to reproduce.
Hardly anyone even bothers to answer me if I ask for a small
self-contained testcase for the problem.

Mark


  parent reply	other threads:[~2001-09-19  6:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-17 12:47 H . J . Lu
     [not found] ` <20010917161350.A25349@lucon.org>
2001-09-17 19:13   ` H . J . Lu
2001-09-18 13:56     ` H . J . Lu
2001-09-18 15:22       ` RFC: Fix gdb 5.1 for Linuxthreads H . J . Lu
2001-09-19  5:42         ` Duncan Palmer
2001-09-19  9:19           ` H . J . Lu
2001-09-20  8:21             ` Duncan Palmer
2001-09-19  7:06         ` Mark Kettenis
2001-09-19  8:58           ` H . J . Lu
2001-09-19  0:46       ` Is the current gdb 5.1 broken for Linuxthreads? Eli Zaretskii
2001-09-19  8:43         ` H . J . Lu
2001-09-19  6:56       ` Mark Kettenis [this message]
2001-09-19  7:39         ` Eric Paire
2001-09-19  9:05           ` H . J . Lu
2001-09-20  0:59             ` Eric Paire
2001-09-19 13:39           ` Andrew Cagney
2001-09-20  1:36             ` Eric Paire
2001-09-20  8:03               ` H . J . Lu
2001-09-20 21:49                 ` Eric Paire
2001-09-19  9:10         ` H . J . Lu
2001-09-19  6:32     ` Mark Kettenis
2001-09-19  9:16       ` H . J . Lu
2001-09-21  2:27 James Cownie
2001-09-21  5:04 ` Eric Paire
2001-09-21  5:25   ` James Cownie
2001-09-21  8:35   ` H . J . Lu
2001-09-21  8:39   ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s3ik7yvqobd.fsf@soliton.wins.uva.nl \
    --to=kettenis@science.uva.nl \
    --cc=gdb@sourceware.cygnus.com \
    --cc=hjl@lucon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox