Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Burkhardt, Glenn" <Glenn.Burkhardt@goodrich.com>
To: <gdb@sourceware.org>
Subject: RE: fail to attach to process on Solaris
Date: Thu, 22 Sep 2011 13:13:00 -0000	[thread overview]
Message-ID: <F69D5B35CAB1F043B9EE359EDA4318DC0CFC425B@nhc0ex17.goodrich.root.local> (raw)

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.  

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));
  
    val = p_td_thr_get_info (&th, &ti);
!   if (val == TD_NOTHR)
      return pid_to_ptid (-1);  /* Thread must have terminated.  */
    else if (val != 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));
  
    val = p_td_thr_get_info (&th, &ti);
!   if (val == TD_BADTH)
      return pid_to_ptid (-1);  /* Thread must have terminated.  */
    else if (val != 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));
  
    val = p_td_thr_get_info (&th, &ti);
!   if (val == TD_NOTHR)
      return pid_to_ptid (-1);  /* Thread must have terminated.  */
    else if (val != TD_OK)
      error (_("lwp_to_thread: td_thr_get_info: %s."), td_err_string
(val));
  
    return BUILD_THREAD (ti.ti_tid, PIDGET (lwp));
  }
--- 310,321 ----
      error (_("lwp_to_thread: td_thr_validate: %s."), td_err_string
(val));
  
    val = p_td_thr_get_info (&th, &ti);
!   if (val == TD_BADTH)
      return pid_to_ptid (-1);  /* Thread must have terminated.  */
    else if (val != TD_OK)
      error (_("lwp_to_thread: td_thr_get_info: %s."), td_err_string
(val));
+   else if (ti.ti_state == TD_THR_ZOMBIE)
+     return pid_to_ptid (-1);    /* Thread has terminated */
  
    return BUILD_THREAD (ti.ti_tid, PIDGET (lwp));
  }


             reply	other threads:[~2011-09-22 13:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 13:13 Burkhardt, Glenn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-22 15:05 Burkhardt, Glenn
2011-09-02 21:24 ` Pedro Alves
2011-09-20 23:22   ` Burkhardt, Glenn
2011-09-21 14:26     ` Pedro Alves
2011-09-21 16:19       ` Burkhardt, Glenn
2011-09-21 16:46         ` Pedro Alves
2011-09-21 17:16           ` Burkhardt, Glenn
2011-09-21 17:39             ` Pedro Alves
2011-09-21 18:38               ` Burkhardt, Glenn
2011-09-21 18:45               ` Burkhardt, Glenn
2011-09-21 16:28       ` Burkhardt, Glenn

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=F69D5B35CAB1F043B9EE359EDA4318DC0CFC425B@nhc0ex17.goodrich.root.local \
    --to=glenn.burkhardt@goodrich.com \
    --cc=gdb@sourceware.org \
    /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