Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Liam Stewart <liams@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] detaching and threaded linux apps
Date: Mon, 03 Jun 2002 11:36:00 -0000	[thread overview]
Message-ID: <20020603143634.A12472@redhat.com> (raw)


thread_db_detach and lin_lwp_detach don't remove their target operation
structures from the target list when a detach on a threaded application
is done. This leads to the failure of the num_lwps == 1 assertion if a
gdb user (for some reason) detaches again before starting/attaching to a
new inferior.

Liam

-- 
Liam Stewart :: Red Hat Canada, Ltd. :: liams@redhat.com

2002-06-03  Liam Stewart  <liams@redhat.com>

	* lin-lwp.c (lin_lwp_detach): Remove target operation structure
	from target stack after detach operations are done.
	* thread-db.c (thread_db_detach): Ditto.

Index: lin-lwp.c
===================================================================
RCS file: /cvs/src/src/gdb/lin-lwp.c,v
retrieving revision 1.34
diff -c -p -r1.34 lin-lwp.c
*** lin-lwp.c	31 Mar 2002 15:10:38 -0000	1.34
--- lin-lwp.c	3 Jun 2002 18:23:54 -0000
*************** lin_lwp_detach (char *args, int from_tty
*** 498,503 ****
--- 498,505 ----
  
    inferior_ptid = pid_to_ptid (GET_PID (inferior_ptid));
    child_ops.to_detach (args, from_tty);
+ 
+   unpush_target(&lin_lwp_ops);
  }
  \f
  
Index: thread-db.c
===================================================================
RCS file: /cvs/src/src/gdb/thread-db.c,v
retrieving revision 1.22
diff -c -p -r1.22 thread-db.c
*** thread-db.c	23 Mar 2002 17:38:13 -0000	1.22
--- thread-db.c	3 Jun 2002 18:23:54 -0000
*************** thread_db_detach (char *args, int from_t
*** 627,632 ****
--- 627,634 ----
    proc_handle.pid = 0;
  
    target_beneath->to_detach (args, from_tty);
+ 
+   unpush_target(&thread_db_ops);
  }
  
  static void


             reply	other threads:[~2002-06-03 18:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-03 11:36 Liam Stewart [this message]
2002-06-03 14:53 ` Mark Kettenis
2002-06-04  8:54   ` Liam Stewart

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=20020603143634.A12472@redhat.com \
    --to=liams@redhat.com \
    --cc=gdb-patches@sources.redhat.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