123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #include "thread_dbP.h"
- td_err_e
- td_thr_getfpregs (const td_thrhandle_t *th, prfpregset_t *regset)
- {
- struct _pthread_descr_struct pds;
- LOG ("td_thr_getfpregs");
- if (th->th_unique == NULL)
- {
-
- pid_t pid = ps_getpid (th->th_ta_p->ph);
- if (ps_lgetfpregs (th->th_ta_p->ph, pid, regset) != PS_OK)
- return TD_ERR;
- return TD_OK;
- }
-
- if (ps_pdread (th->th_ta_p->ph, th->th_unique, &pds,
- sizeof (struct _pthread_descr_struct)) != PS_OK)
- return TD_ERR;
-
- if (pds.p_terminated)
- memset (regset, '\0', sizeof (*regset));
-
- else
- {
- pid_t pid = pds.p_pid ?: ps_getpid (th->th_ta_p->ph);
- if (ps_lgetfpregs (th->th_ta_p->ph, pid, regset) != PS_OK)
- return TD_ERR;
- }
- return TD_OK;
- }
|