Changeset View
Changeset View
Standalone View
Standalone View
gnu/usr.bin/gdb/libgdb/fbsd-threads.c
Show First 20 Lines • Show All 625 Lines • ▼ Show 20 Lines | else | ||||
} | } | ||||
lwp = GET_LWP (work_ptid); | lwp = GET_LWP (work_ptid); | ||||
if (lwp == 0) | if (lwp == 0) | ||||
{ | { | ||||
/* check user thread */ | /* check user thread */ | ||||
ret = td_ta_map_id2thr_p (thread_agent, GET_THREAD(work_ptid), &th); | ret = td_ta_map_id2thr_p (thread_agent, GET_THREAD(work_ptid), &th); | ||||
if (ret) | if (ret) | ||||
error (thread_db_err_str (ret)); | error ("%s", thread_db_err_str (ret)); | ||||
/* For M:N thread, we need to tell UTS to set/unset single step | /* For M:N thread, we need to tell UTS to set/unset single step | ||||
flag at context switch time, the flag will be written into | flag at context switch time, the flag will be written into | ||||
thread mailbox. This becauses some architecture may not have | thread mailbox. This becauses some architecture may not have | ||||
machine single step flag in ucontext, so we put the flag in mailbox, | machine single step flag in ucontext, so we put the flag in mailbox, | ||||
when the thread switches back, kse_switchin restores the single step | when the thread switches back, kse_switchin restores the single step | ||||
state. */ | state. */ | ||||
ret = td_thr_sstep_p (&th, step); | ret = td_thr_sstep_p (&th, step); | ||||
if (ret) | if (ret) | ||||
error (thread_db_err_str (ret)); | error ("%s", thread_db_err_str (ret)); | ||||
ret = td_thr_get_info_p (&th, &ti); | ret = td_thr_get_info_p (&th, &ti); | ||||
if (ret) | if (ret) | ||||
error (thread_db_err_str (ret)); | error ("%s", thread_db_err_str (ret)); | ||||
thvalid = 1; | thvalid = 1; | ||||
lwp = ti.ti_lid; | lwp = ti.ti_lid; | ||||
} | } | ||||
if (lwp) | if (lwp) | ||||
{ | { | ||||
int req = step ? PT_SETSTEP : PT_CLEARSTEP; | int req = step ? PT_SETSTEP : PT_CLEARSTEP; | ||||
if (ptrace (req, (pid_t) lwp, (caddr_t) 1, target_signal_to_host(signo))) | if (ptrace (req, (pid_t) lwp, (caddr_t) 1, target_signal_to_host(signo))) | ||||
▲ Show 20 Lines • Show All 362 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
supply_register (regno, old_value); | supply_register (regno, old_value); | ||||
} | } | ||||
fill_gregset (gregset, regno); | fill_gregset (gregset, regno); | ||||
err = td_thr_setgregs_p (&th, gregset); | err = td_thr_setgregs_p (&th, gregset); | ||||
if (err != TD_OK) | if (err != TD_OK) | ||||
error ("Cannot store general-purpose registers for thread %d: Thread ID=%d, %s", | error ("Cannot store general-purpose registers for thread %d: Thread ID=%d, %s", | ||||
pid_to_thread_id (inferior_ptid), GET_THREAD (inferior_ptid), | pid_to_thread_id (inferior_ptid), (int)GET_THREAD (inferior_ptid), | ||||
thread_db_err_str (err)); | thread_db_err_str (err)); | ||||
#ifdef PT_GETXMMREGS | #ifdef PT_GETXMMREGS | ||||
i387_fill_fxsave (xmmregs, regno); | i387_fill_fxsave (xmmregs, regno); | ||||
err = td_thr_setxmmregs_p (&th, xmmregs); | err = td_thr_setxmmregs_p (&th, xmmregs); | ||||
if (err == TD_OK) | if (err == TD_OK) | ||||
return; | return; | ||||
#endif | #endif | ||||
fill_fpregset (&fpregset, regno); | fill_fpregset (&fpregset, regno); | ||||
err = td_thr_setfpregs_p (&th, &fpregset); | err = td_thr_setfpregs_p (&th, &fpregset); | ||||
if (err != TD_OK) | if (err != TD_OK) | ||||
error ("Cannot store floating-point registers for thread %d: Thread ID=%d, %s", | error ("Cannot store floating-point registers for thread %d: Thread ID=%d, %s", | ||||
pid_to_thread_id (inferior_ptid), GET_THREAD (inferior_ptid), | pid_to_thread_id (inferior_ptid), (int)GET_THREAD (inferior_ptid), | ||||
thread_db_err_str (err)); | thread_db_err_str (err)); | ||||
} | } | ||||
static void | static void | ||||
fbsd_thread_kill (void) | fbsd_thread_kill (void) | ||||
{ | { | ||||
child_ops.to_kill(); | child_ops.to_kill(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 751 Lines • Show Last 20 Lines |