From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5953 invoked by alias); 22 Sep 2011 13:13:09 -0000 Received: (qmail 5927 invoked by uid 22791); 22 Sep 2011 13:13:07 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from phx-mxvgateway.goodrich.com (HELO phx-mxv1gateway.goodrich.com) (63.241.174.110) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Sep 2011 13:12:53 +0000 Received: from GR-GWI-WEST-A.goodrich.com (gr-gwi-west-a.goodrich.com [170.126.245.4]) by phx-mxv1gateway.goodrich.com (Symantec Messaging Gateway) with SMTP id DE.D7.25480.4543B7E4; Thu, 22 Sep 2011 09:12:53 -0400 (EDT) Received: from nhc0ex21.goodrich.root.local ([170.126.245.60]) by GR-GWI-WEST-A.goodrich.com (8.13.5/8.13.5) with ESMTP id p8MDCloA019264 for ; Thu, 22 Sep 2011 09:12:52 -0400 (EDT) Received: from nhc0ex17.goodrich.root.local ([170.126.246.106]) by nhc0ex21.goodrich.root.local with Microsoft SMTPSVC(6.0.3790.4675); Thu, 22 Sep 2011 06:12:48 -0700 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: fail to attach to process on Solaris Date: Thu, 22 Sep 2011 13:13:00 -0000 Message-ID: From: "Burkhardt, Glenn" To: Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00092.txt.bz2 I took a look at the other places where changes might be needed, and I only found one. But I'm not completely sure about it.=20=20 There are also a couple of places where the return code from p_td_thr_get_info() is compared against the value TD_NOTHR, but the documentation doesn't list that as a possible return value. Probably TD_BADTH is better. I suggest these changes in addition to your patch. *** sol-thread.c.orig 2011-09-21 18:42:12.506406776 -0400 --- sol-thread.c 2011-09-21 18:58:55.600242634 -0400 *************** *** 261,267 **** error (_("thread_to_lwp: td_ta_map_id2thr %s"), td_err_string (val)); =20=20 val =3D p_td_thr_get_info (&th, &ti); ! if (val =3D=3D TD_NOTHR) return pid_to_ptid (-1); /* Thread must have terminated. */ else if (val !=3D TD_OK) error (_("thread_to_lwp: td_thr_get_info: %s"), td_err_string (val)); --- 261,267 ---- error (_("thread_to_lwp: td_ta_map_id2thr %s"), td_err_string (val)); =20=20 val =3D p_td_thr_get_info (&th, &ti); ! if (val =3D=3D TD_BADTH) return pid_to_ptid (-1); /* Thread must have terminated. */ else if (val !=3D TD_OK) error (_("thread_to_lwp: td_thr_get_info: %s"), td_err_string (val)); *************** *** 310,319 **** error (_("lwp_to_thread: td_thr_validate: %s."), td_err_string (val)); =20=20 val =3D p_td_thr_get_info (&th, &ti); ! if (val =3D=3D TD_NOTHR) return pid_to_ptid (-1); /* Thread must have terminated. */ else if (val !=3D TD_OK) error (_("lwp_to_thread: td_thr_get_info: %s."), td_err_string (val)); =20=20 return BUILD_THREAD (ti.ti_tid, PIDGET (lwp)); } --- 310,321 ---- error (_("lwp_to_thread: td_thr_validate: %s."), td_err_string (val)); =20=20 val =3D p_td_thr_get_info (&th, &ti); ! if (val =3D=3D TD_BADTH) return pid_to_ptid (-1); /* Thread must have terminated. */ else if (val !=3D TD_OK) error (_("lwp_to_thread: td_thr_get_info: %s."), td_err_string (val)); + else if (ti.ti_state =3D=3D TD_THR_ZOMBIE) + return pid_to_ptid (-1); /* Thread has terminated */ =20=20 return BUILD_THREAD (ti.ti_tid, PIDGET (lwp)); }