From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10515 invoked by alias); 3 Jun 2002 18:36:36 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10507 invoked from network); 3 Jun 2002 18:36:36 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 3 Jun 2002 18:36:36 -0000 Received: from tooth.toronto.redhat.com (unknown [172.16.14.29]) by touchme.toronto.redhat.com (Postfix) with ESMTP id BE57DB8013 for ; Mon, 3 Jun 2002 14:36:35 -0400 (EDT) Received: (from liams@localhost) by tooth.toronto.redhat.com (8.11.6/8.11.6) id g53IaZw03801 for gdb-patches@sources.redhat.com; Mon, 3 Jun 2002 14:36:35 -0400 X-Authentication-Warning: tooth.toronto.redhat.com: liams set sender to liams@redhat.com using -f Date: Mon, 03 Jun 2002 11:36:00 -0000 From: Liam Stewart To: gdb-patches@sources.redhat.com Subject: [PATCH] detaching and threaded linux apps Message-ID: <20020603143634.A12472@redhat.com> Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-SW-Source: 2002-06/txt/msg00046.txt.bz2 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 * 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); } 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