Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@science.uva.nl>
To: Kevin Buettner <kevinb@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH RFA] lin-lwp.c: Mark main thread as stopped when attaching
Date: Thu, 08 Nov 2001 13:04:00 -0000	[thread overview]
Message-ID: <s3ioflwfhu4.fsf@soliton.wins.uva.nl> (raw)
In-Reply-To: Kevin Buettner's message of Mon, 19 Nov 2001 12:57:35 -0700

Kevin Buettner <kevinb@cygnus.com> writes:

> The patch below marks the main pid as stopped when attaching.  If it
> is not marked as such, then it is not (re)started when continuing if
> the user first changes the current thread.
> 
> The practical effects of this problem may be demonstrated on a
> Linux/x86 sytem as follows:
> 
> 1) Start the linux-dp program and make note of the process id of the
>    main thread.
> 2) Debug the linux-dp program and attach to PID representing the
>    main thread.
> 3) Do ``info threads'' and pick out a thread other than the main
>    one.
> 4) Use GDB's ``thread'' command to switch to this thread.
> 5) Continue the program.
> 6) Attempt to interrupt the program with Ctrl-C.  It will be impossible
>    to do so.  (Examining the threads from another shell with the
>    ``ps'' command is also instructive at this stage.)

Ah yes, the initial attach doesn't go through the lin_lwp layer.  When
the libthreads_db stuff is detected and lin_lwp_attach_lwp is called
for all threads the main thread isn't marked as stopped.

> Jim Blandy deserves credit for arriving at the above procedure for
> reproducing this problem.
> 
> The patch below fixes this bug.  Okay to commit?

Could you change the comment to say that we *assume* that the thread is
stopped and therefore mark it as such?  Otherwise OK.

Mark


  reply	other threads:[~2001-11-21 12:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-07 16:06 Kevin Buettner
2001-11-08 13:04 ` Mark Kettenis [this message]
2001-11-08 19:30   ` Kevin Buettner

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=s3ioflwfhu4.fsf@soliton.wins.uva.nl \
    --to=kettenis@science.uva.nl \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kevinb@cygnus.com \
    /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