Lines Matching refs:th

47 static int pt_validate(const td_thrhandle_t *th);
220 pt_ta_map_id2thr(const td_thragent_t *ta, thread_t id, td_thrhandle_t *th)
287 th->th_ta = ta;
288 th->th_tid = id;
289 th->th_thread = pt;
294 pt_ta_map_lwp2thr(const td_thragent_t *ta, lwpid_t lwp, td_thrhandle_t *th)
314 th->th_ta = ta;
315 th->th_tid = pt_map_thread(ta, pt, PT_USER);
316 if (th->th_tid == -1)
319 th->th_thread = pt;
337 td_thrhandle_t th;
355 th.th_ta = ta;
356 th.th_tid = pt_map_thread(ta, pt, PT_USER);
357 th.th_thread = pt;
359 if (th.th_tid == -1)
361 if ((*callback)(&th, cbdata_p))
439 pt_dbsuspend(const td_thrhandle_t *th, int suspend)
441 const td_thragent_t *ta = th->th_ta;
449 ret = pt_validate(th);
453 if (ta->map[th->th_tid].type == PT_LWP) {
455 ret = ps_lstop(ta->ph, ta->map[th->th_tid].lwp);
457 ret = ps_lcontinue(ta->ph, ta->map[th->th_tid].lwp);
461 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr +
466 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr +
486 ptr = ta->map[th->th_tid].thr + ta->thread_off_kse;
495 ptr = ta->map[th->th_tid].thr +
544 pt_thr_dbresume(const td_thrhandle_t *th)
548 return pt_dbsuspend(th, 0);
552 pt_thr_dbsuspend(const td_thrhandle_t *th)
556 return pt_dbsuspend(th, 1);
560 pt_thr_validate(const td_thrhandle_t *th)
567 ret = pt_ta_map_id2thr(th->th_ta, th->th_tid,
573 pt_thr_old_get_info(const td_thrhandle_t *th, td_old_thrinfo_t *info)
575 const td_thragent_t *ta = th->th_ta;
587 ret = pt_validate(th);
592 if (ta->map[th->th_tid].type == PT_LWP) {
594 info->ti_lid = ta->map[th->th_tid].lwp;
595 info->ti_tid = th->th_tid;
601 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr +
606 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr + ta->thread_off_tcb,
610 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr + ta->thread_off_state,
628 info->ti_ta_p = th->th_ta;
629 info->ti_tid = th->th_tid;
640 ta->map[th->th_tid].thr + ta->thread_off_sigmask,
645 ta->map[th->th_tid].thr + ta->thread_off_sigpend,
663 pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info)
667 e = pt_thr_old_get_info(th, (td_old_thrinfo_t *)info);
674 pt_thr_getxmmregs(const td_thrhandle_t *th, char *fxsave)
676 const td_thragent_t *ta = th->th_ta;
686 ret = pt_validate(th);
690 if (ta->map[th->th_tid].type == PT_LWP) {
691 ret = ps_lgetxmmregs(ta->ph, ta->map[th->th_tid].lwp, fxsave);
695 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr + ta->thread_off_tcb,
718 pt_thr_getfpregs(const td_thrhandle_t *th, prfpregset_t *fpregs)
720 const td_thragent_t *ta = th->th_ta;
728 ret = pt_validate(th);
732 if (ta->map[th->th_tid].type == PT_LWP) {
733 ret = ps_lgetfpregs(ta->ph, ta->map[th->th_tid].lwp, fpregs);
737 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr + ta->thread_off_tcb,
759 pt_thr_getgregs(const td_thrhandle_t *th, prgregset_t gregs)
761 const td_thragent_t *ta = th->th_ta;
769 ret = pt_validate(th);
773 if (ta->map[th->th_tid].type == PT_LWP) {
775 ta->map[th->th_tid].lwp, gregs);
779 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr + ta->thread_off_tcb,
801 pt_thr_setxmmregs(const td_thrhandle_t *th, const char *fxsave)
803 const td_thragent_t *ta = th->th_ta;
813 ret = pt_validate(th);
817 if (ta->map[th->th_tid].type == PT_LWP) {
818 ret = ps_lsetxmmregs(ta->ph, ta->map[th->th_tid].lwp, fxsave);
822 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr +
851 pt_thr_setfpregs(const td_thrhandle_t *th, const prfpregset_t *fpregs)
853 const td_thragent_t *ta = th->th_ta;
861 ret = pt_validate(th);
865 if (ta->map[th->th_tid].type == PT_LWP) {
866 ret = ps_lsetfpregs(ta->ph, ta->map[th->th_tid].lwp, fpregs);
870 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr +
898 pt_thr_setgregs(const td_thrhandle_t *th, const prgregset_t gregs)
900 const td_thragent_t *ta = th->th_ta;
908 ret = pt_validate(th);
912 if (ta->map[th->th_tid].type == PT_LWP) {
913 ret = ps_lsetregs(ta->ph, ta->map[th->th_tid].lwp, gregs);
917 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr +
945 pt_thr_event_enable(const td_thrhandle_t *th __unused, int en __unused)
952 pt_thr_set_event(const td_thrhandle_t *th __unused,
960 pt_thr_clear_event(const td_thrhandle_t *th __unused,
968 pt_thr_event_getmsg(const td_thrhandle_t *th __unused,
976 pt_thr_sstep(const td_thrhandle_t *th, int step)
978 const td_thragent_t *ta = th->th_ta;
988 ret = pt_validate(th);
992 if (ta->map[th->th_tid].type == PT_LWP)
995 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr +
1061 pt_validate(const td_thrhandle_t *th)
1064 if (th->th_tid < 0 || th->th_tid >= th->th_ta->map_len ||
1065 th->th_ta->map[th->th_tid].type == PT_NONE)
1071 pt_thr_tls_get_addr(const td_thrhandle_t *th, psaddr_t _linkmap, size_t offset,
1074 const td_thragent_t *ta = th->th_ta;
1089 ret = ps_pread(ta->ph, ta->map[th->th_tid].thr +