Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@wins.uva.nl>
To: gdb-patches@sources.redhat.com
Cc: ken@believe.com
Subject: [PATCH] Fix check for resumed threads
Date: Fri, 13 Jul 2001 05:53:00 -0000	[thread overview]
Message-ID: <200107131252.f6DCqpN01870@delius.kettenis.local> (raw)

lin_lwp_wait() may be called when the list of LWPs is still empty
(this will add the LWP for which we receive an event to the list
automatically.  This happens when debugging a statically linked
program.

Thanks to Ken Whaley for reporting this.

Mark

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* lin-lwp.c (lin_lwp_wait): Avoid check for resumed LWPs if there
	are no registered LWPs yet.

Index: lin-lwp.c
===================================================================
RCS file: /cvs/src/src/gdb/lin-lwp.c,v
retrieving revision 1.28
diff -u -p -r1.28 lin-lwp.c
--- lin-lwp.c 2001/07/12 19:37:36 1.28
+++ lin-lwp.c 2001/07/13 12:03:05
@@ -908,8 +908,9 @@ lin_lwp_wait (ptid_t ptid, struct target
 
  retry:
 
-  /* Make sure there is at least one thread that has been resumed.  */
-  gdb_assert (iterate_over_lwps (resumed_callback, NULL));
+  /* Make sure there is at least one LWP that has been resumed, at
+     least if there are any LWPs at all.  */
+  gdb_assert (num_lwps == 0 || iterate_over_lwps (resumed_callback, NULL));
 
   /* First check if there is a LWP with a wait status pending.  */
   if (pid == -1)


                 reply	other threads:[~2001-07-13  5:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200107131252.f6DCqpN01870@delius.kettenis.local \
    --to=kettenis@wins.uva.nl \
    --cc=gdb-patches@sources.redhat.com \
    --cc=ken@believe.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