FreeBSD/gnu/usr.bin/gdb/libgdb/fbsd-threads.c
/* Convert LWP to user-level thread id. */
Convert LWP to user-level thread id.
Convert LWP to user - level thread id .
static ptid_t
thread_from_lwp (ptid_t ptid, td_thrhandle_t *th, td_thrinfo_t *ti)
{
  td_err_e err;
  gdb_assert (IS_LWP (ptid));
  if (fbsd_thread_active)
    {
      err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), th);
      if (err == TD_OK)
        {
          err = td_thr_get_info_p (th, ti);
          if (err != TD_OK)
            error ("Cannot get thread info: %s", thread_db_err_str (err));
          return BUILD_THREAD (ti->ti_tid, GET_PID (ptid));
        }
    }
  return BUILD_LWP (GET_LWP (ptid), GET_PID (ptid));
}
static ptid_t thread_from_lwp ( ptid_t ptid , td_thrhandle_t * th , td_thrinfo_t * ti ) { td_err_e err ; gdb_assert ( IS_LWP ( ptid ) ) ; if ( fbsd_thread_active ) { err = td_ta_map_lwp2thr_p ( thread_agent , GET_LWP ( ptid ) , th ) ; if ( err == TD_OK ) { err = td_thr_get_info_p ( th , ti ) ; if ( err != TD_OK ) error ( " " , thread_db_err_str ( err ) ) ; return BUILD_THREAD ( ti -> ti_tid , GET_PID ( ptid ) ) ; } } return BUILD_LWP ( GET_LWP ( ptid ) , GET_PID ( ptid ) ) ; }
Convert LWP to user-level thread id.
Convert LWP to user - level thread id .
/* the LWP is not mapped to user thread */