Lines Matching refs:tid
711 static Bool is_sig_ign(vki_siginfo_t *info, ThreadId tid) in is_sig_ign() argument
718 return !VG_(gdbserver_report_signal) (info, tid) in is_sig_ign()
1100 static Bool on_sig_stack ( ThreadId tid, Addr m_SP ) in on_sig_stack() argument
1102 ThreadState *tst = VG_(get_ThreadState)(tid); in on_sig_stack()
1107 static Int sas_ss_flags ( ThreadId tid, Addr m_SP ) in sas_ss_flags() argument
1109 ThreadState *tst = VG_(get_ThreadState)(tid); in sas_ss_flags()
1113 : on_sig_stack(tid, m_SP) ? VKI_SS_ONSTACK : 0); in sas_ss_flags()
1117 SysRes VG_(do_sys_sigaltstack) ( ThreadId tid, vki_stack_t* ss, vki_stack_t* oss ) in VG_()
1121 vg_assert(VG_(is_valid_tid)(tid)); in VG_()
1122 m_SP = VG_(get_SP)(tid); in VG_()
1127 tid, (void*)ss, in VG_()
1134 oss->ss_sp = VG_(threads)[tid].altstack.ss_sp; in VG_()
1135 oss->ss_size = VG_(threads)[tid].altstack.ss_size; in VG_()
1136 oss->ss_flags = VG_(threads)[tid].altstack.ss_flags in VG_()
1137 | sas_ss_flags(tid, m_SP); in VG_()
1141 if (on_sig_stack(tid, VG_(get_SP)(tid))) { in VG_()
1150 VG_(threads)[tid].altstack.ss_flags = VKI_SS_DISABLE; in VG_()
1156 VG_(threads)[tid].altstack.ss_sp = ss->ss_sp; in VG_()
1157 VG_(threads)[tid].altstack.ss_size = ss->ss_size; in VG_()
1158 VG_(threads)[tid].altstack.ss_flags = 0; in VG_()
1313 void do_setmask ( ThreadId tid, in do_setmask() argument
1320 tid, how, in do_setmask()
1327 vg_assert(VG_(is_valid_tid)(tid)); in do_setmask()
1329 *oldset = VG_(threads)[tid].sig_mask; in do_setmask()
1334 do_sigprocmask_bitops (how, &VG_(threads)[tid].sig_mask, newset ); in do_setmask()
1335 VG_(sigdelset)(&VG_(threads)[tid].sig_mask, VKI_SIGKILL); in do_setmask()
1336 VG_(sigdelset)(&VG_(threads)[tid].sig_mask, VKI_SIGSTOP); in do_setmask()
1337 VG_(threads)[tid].tmp_sig_mask = VG_(threads)[tid].sig_mask; in do_setmask()
1342 SysRes VG_(do_sys_sigprocmask) ( ThreadId tid, in VG_()
1351 vg_assert(VG_(is_valid_tid)(tid)); in VG_()
1352 do_setmask ( tid, how, set, oldset ); in VG_()
1389 void VG_(clear_out_queued_signals)( ThreadId tid, vki_sigset_t* saved_mask ) in VG_()
1392 if (VG_(threads)[tid].sig_queue != NULL) { in VG_()
1393 VG_(free)(VG_(threads)[tid].sig_queue); in VG_()
1394 VG_(threads)[tid].sig_queue = NULL; in VG_()
1407 void push_signal_frame ( ThreadId tid, const vki_siginfo_t *siginfo, in push_signal_frame() argument
1416 vg_assert(VG_(is_valid_tid)(tid)); in push_signal_frame()
1417 tst = & VG_(threads)[tid]; in push_signal_frame()
1420 VG_(dmsg)("push_signal_frame (thread %u): signal %d\n", tid, sigNo); in push_signal_frame()
1421 VG_(get_and_pp_StackTrace)(tid, 10); in push_signal_frame()
1429 sas_ss_flags(tid, VG_(get_SP)(tid)) == 0 in push_signal_frame()
1437 sigNo, VG_(signame)(sigNo), tid, tst->altstack.ss_sp, in push_signal_frame()
1442 esp_top_of_frame = VG_(get_SP)(tid) - VG_STACK_REDZONE_SZB; in push_signal_frame()
1446 VG_TRACK( pre_deliver_signal, tid, sigNo, on_altstack ); in push_signal_frame()
1454 VG_(sigframe_create) (tid, on_altstack, esp_top_of_frame, siginfo, uc, in push_signal_frame()
1589 static Bool is_signal_from_kernel(ThreadId tid, int signum, int si_code) in is_signal_from_kernel() argument
1613 if (VG_(threads)[tid].status == VgTs_WaitSys) { in is_signal_from_kernel()
1640 static void default_action(const vki_siginfo_t *info, ThreadId tid) in default_action() argument
1647 ThreadState* tst = VG_(get_ThreadState)(tid); in default_action()
1649 vg_assert(VG_(is_running_thread)(tid)); in default_action()
1730 || (could_core && is_signal_from_kernel(tid, sigNo, info->si_code)) in default_action()
1734 VG_(printf_xml)(" <tid>%d</tid>\n", tid); in default_action()
1750 if (is_signal_from_kernel(tid, sigNo, info->si_code)) { in default_action()
1839 if (VG_(is_valid_tid)(tid)) { in default_action()
1850 if (tid == 1) { // main thread in default_action()
1851 Addr esp = VG_(get_SP)(tid); in default_action()
1854 && VG_(extend_stack)(tid, base)) { in default_action()
1876 (VG_(get_SP)(tid), sizeof(Addr), VKI_PROT_READ) in default_action()
1877 ? VG_(record_ExeContext)( tid, first_ip_delta ) in default_action()
1878 : VG_(record_depth_1_ExeContext)( tid, in default_action()
1884 && is_signal_from_kernel(tid, sigNo, info->si_code) in default_action()
1908 VG_(gdbserver_report_fatal_signal) (info, tid); in default_action()
1914 VG_(make_coredump)(tid, info, corelim.rlim_cur); in default_action()
1925 VG_(nuke_all_threads_except)(tid, VgSrc_FatalSig); in default_action()
1926 VG_(reap_threads)(tid); in default_action()
1928 VG_(threads)[tid].exitreason = VgSrc_FatalSig; in default_action()
1929 VG_(threads)[tid].os_state.fatalsig = sigNo; in default_action()
1940 static void deliver_signal ( ThreadId tid, const vki_siginfo_t *info, in deliver_signal() argument
1946 ThreadState *tst = VG_(get_ThreadState)(tid); in deliver_signal()
1950 sigNo, VG_(signame)(sigNo), info->si_code, tid ); in deliver_signal()
1957 vg_assert(VG_(is_exiting)(tid)); in deliver_signal()
1974 default_action(info, tid); in deliver_signal()
1986 vg_assert(VG_(is_valid_tid)(tid)); in deliver_signal()
1988 push_signal_frame ( tid, info, uc ); in deliver_signal()
2015 static void resume_scheduler(ThreadId tid) in resume_scheduler() argument
2017 ThreadState *tst = VG_(get_ThreadState)(tid); in resume_scheduler()
2028 static void synth_fault_common(ThreadId tid, Addr addr, Int si_code) in synth_fault_common() argument
2032 vg_assert(VG_(threads)[tid].status == VgTs_Runnable); in synth_fault_common()
2041 (void) VG_(gdbserver_report_signal) (&info, tid); in synth_fault_common()
2044 if (VG_(sigismember)(&VG_(threads)[tid].sig_mask, VKI_SIGSEGV)) in synth_fault_common()
2047 deliver_signal(tid, &info, NULL); in synth_fault_common()
2052 void VG_(synth_fault_perms)(ThreadId tid, Addr addr) in VG_()
2054 synth_fault_common(tid, addr, VKI_SEGV_ACCERR); in VG_()
2058 void VG_(synth_fault_mapping)(ThreadId tid, Addr addr) in VG_()
2060 synth_fault_common(tid, addr, VKI_SEGV_MAPERR); in VG_()
2064 void VG_(synth_fault)(ThreadId tid) in VG_()
2066 synth_fault_common(tid, 0, VKI_SEGV_MADE_UP_GPF); in VG_()
2070 void VG_(synth_sigill)(ThreadId tid, Addr addr) in VG_()
2074 vg_assert(VG_(threads)[tid].status == VgTs_Runnable); in VG_()
2081 if (VG_(gdbserver_report_signal) (&info, tid)) { in VG_()
2082 resume_scheduler(tid); in VG_()
2083 deliver_signal(tid, &info, NULL); in VG_()
2086 resume_scheduler(tid); in VG_()
2090 void VG_(synth_sigbus)(ThreadId tid) in VG_()
2094 vg_assert(VG_(threads)[tid].status == VgTs_Runnable); in VG_()
2106 if (VG_(gdbserver_report_signal) (&info, tid)) { in VG_()
2107 resume_scheduler(tid); in VG_()
2108 deliver_signal(tid, &info, NULL); in VG_()
2111 resume_scheduler(tid); in VG_()
2115 void VG_(synth_sigtrap)(ThreadId tid) in VG_()
2125 vg_assert(VG_(threads)[tid].status == VgTs_Runnable); in VG_()
2149 if (VG_(gdbserver_report_signal) (&info, tid)) { in VG_()
2150 resume_scheduler(tid); in VG_()
2151 deliver_signal(tid, &info, &uc); in VG_()
2154 resume_scheduler(tid); in VG_()
2158 void VG_(synth_sigfpe)(ThreadId tid, UInt code) in VG_()
2167 vg_assert(VG_(threads)[tid].status == VgTs_Runnable); in VG_()
2174 if (VG_(gdbserver_report_signal) (&info, tid)) { in VG_()
2175 resume_scheduler(tid); in VG_()
2176 deliver_signal(tid, &info, &uc); in VG_()
2179 resume_scheduler(tid); in VG_()
2191 void queue_signal(ThreadId tid, const vki_siginfo_t *si) in queue_signal() argument
2197 tst = VG_(get_ThreadState)(tid); in queue_signal()
2210 si->si_signo, sq->next, tid); in queue_signal()
2220 sq->sigs[sq->next].si_signo, tid); in queue_signal()
2236 static vki_siginfo_t *next_queued(ThreadId tid, const vki_sigset_t *set) in next_queued() argument
2238 ThreadState *tst = VG_(get_ThreadState)(tid); in next_queued()
2258 sq->sigs[idx].si_signo, idx, tid); in next_queued()
2298 static void async_signalhandler_solaris_preprocess(ThreadId tid, Int *signo, in async_signalhandler_solaris_preprocess() argument
2305 ThreadState *tst = VG_(get_ThreadState)(tid); in async_signalhandler_solaris_preprocess()
2402 ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)()); in async_signalhandler() local
2403 ThreadState* tst = VG_(get_ThreadState)(tid); in async_signalhandler()
2409 async_signalhandler_solaris_preprocess(tid, &sigNo, info, uc); in async_signalhandler()
2413 VG_(acquire_BigLock)(tid, "async_signalhandler"); in async_signalhandler()
2420 sigNo, tid, info->si_code, in async_signalhandler()
2425 resume_scheduler(tid); in async_signalhandler()
2465 tid, in async_signalhandler()
2482 && !is_sig_ign(info, tid)) in async_signalhandler()
2483 deliver_signal(tid, info, uc); in async_signalhandler()
2500 resume_scheduler(tid); in async_signalhandler()
2519 Bool VG_(extend_stack)(ThreadId tid, Addr addr) in VG_()
2551 tid, new_stack_base); in VG_()
2554 "to %#lx\n", tid, new_stack_base); in VG_()
2578 void sync_signalhandler_from_user ( ThreadId tid, in sync_signalhandler_from_user() argument
2587 if (VG_(threads)[tid].status == VgTs_WaitSys in sync_signalhandler_from_user()
2591 && VG_(is_ip_in_blocking_syscall)(tid, VG_UCONTEXT_INSTR_PTR(uc)) in sync_signalhandler_from_user()
2643 deliver_signal(tid, info, uc); in sync_signalhandler_from_user()
2644 resume_scheduler(tid); in sync_signalhandler_from_user()
2652 qtid = tid; /* directed to us specifically */ in sync_signalhandler_from_user()
2674 static Bool extend_stack_if_appropriate(ThreadId tid, vki_siginfo_t* info) in extend_stack_if_appropriate() argument
2684 esp = VG_(get_SP)(tid); in extend_stack_if_appropriate()
2693 info->si_code, fault, tid, esp); in extend_stack_if_appropriate()
2697 info->si_code, fault, tid, esp, seg->start, seg->end); in extend_stack_if_appropriate()
2714 && VG_(extend_stack)(tid, base)) { in extend_stack_if_appropriate()
2728 void sync_signalhandler_from_kernel ( ThreadId tid, in sync_signalhandler_from_kernel() argument
2743 if (extend_stack_if_appropriate(tid, info)) { in sync_signalhandler_from_kernel()
2751 ThreadState *tst = VG_(get_ThreadState)(tid); in sync_signalhandler_from_kernel()
2759 if (VG_(gdbserver_report_signal) (info, tid) in sync_signalhandler_from_kernel()
2763 deliver_signal(tid, info, uc); in sync_signalhandler_from_kernel()
2764 resume_scheduler(tid); in sync_signalhandler_from_kernel()
2767 resume_scheduler(tid); in sync_signalhandler_from_kernel()
2788 vg_assert(tid != 0); in sync_signalhandler_from_kernel()
2805 ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)()); in sync_signalhandler() local
2821 from_user = !is_signal_from_kernel(tid, sigNo, info->si_code); in sync_signalhandler()
2826 sigNo, info->si_code, VG_(get_IP)(tid), in sync_signalhandler()
2849 sync_signalhandler_from_user( tid, sigNo, info, uc); in sync_signalhandler()
2851 sync_signalhandler_from_kernel(tid, sigNo, info, uc); in sync_signalhandler()
2869 ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)()); in sigvgkill_handler() local
2870 ThreadStatus at_signal = VG_(threads)[tid].status; in sigvgkill_handler()
2873 VG_(dmsg)("sigvgkill for lwp %d tid %u\n", VG_(gettid)(), tid); in sigvgkill_handler()
2875 VG_(acquire_BigLock)(tid, "sigvgkill_handler"); in sigvgkill_handler()
2891 VG_(post_syscall)(tid); in sigvgkill_handler()
2894 resume_scheduler(tid); in sigvgkill_handler()
2941 void VG_(poll_signals)(ThreadId tid) in VG_()
2945 ThreadState *tst = VG_(get_ThreadState)(tid); in VG_()
2958 tid, VG_(name_of_VgSchedReturnCode)(tst->exitreason)); in VG_()
2969 sip = next_queued(tid, &pollset); /* this thread */ in VG_()
2978 si.si_signo, tid, in VG_()
2987 sip->si_signo, tid, in VG_()
2989 if (!is_sig_ign(sip, tid)) in VG_()
2990 deliver_signal(tid, sip, NULL); in VG_()