• Home
  • Raw
  • Download

Lines Matching refs:tid

697 static Bool is_sig_ign(vki_siginfo_t *info, ThreadId tid)  in is_sig_ign()  argument
704 return !VG_(gdbserver_report_signal) (info, tid) in is_sig_ign()
1064 static Bool on_sig_stack ( ThreadId tid, Addr m_SP ) in on_sig_stack() argument
1066 ThreadState *tst = VG_(get_ThreadState)(tid); in on_sig_stack()
1071 static Int sas_ss_flags ( ThreadId tid, Addr m_SP ) in sas_ss_flags() argument
1073 ThreadState *tst = VG_(get_ThreadState)(tid); in sas_ss_flags()
1077 : on_sig_stack(tid, m_SP) ? VKI_SS_ONSTACK : 0); in sas_ss_flags()
1081 SysRes VG_(do_sys_sigaltstack) ( ThreadId tid, vki_stack_t* ss, vki_stack_t* oss ) in VG_()
1085 vg_assert(VG_(is_valid_tid)(tid)); in VG_()
1086 m_SP = VG_(get_SP)(tid); in VG_()
1091 tid, (void*)ss, in VG_()
1098 oss->ss_sp = VG_(threads)[tid].altstack.ss_sp; in VG_()
1099 oss->ss_size = VG_(threads)[tid].altstack.ss_size; in VG_()
1100 oss->ss_flags = VG_(threads)[tid].altstack.ss_flags in VG_()
1101 | sas_ss_flags(tid, m_SP); in VG_()
1105 if (on_sig_stack(tid, VG_(get_SP)(tid))) { in VG_()
1114 VG_(threads)[tid].altstack.ss_flags = VKI_SS_DISABLE; in VG_()
1120 VG_(threads)[tid].altstack.ss_sp = ss->ss_sp; in VG_()
1121 VG_(threads)[tid].altstack.ss_size = ss->ss_size; in VG_()
1122 VG_(threads)[tid].altstack.ss_flags = 0; in VG_()
1275 void do_setmask ( ThreadId tid, in do_setmask() argument
1282 tid, how, in do_setmask()
1289 vg_assert(VG_(is_valid_tid)(tid)); in do_setmask()
1291 *oldset = VG_(threads)[tid].sig_mask; in do_setmask()
1296 do_sigprocmask_bitops (how, &VG_(threads)[tid].sig_mask, newset ); in do_setmask()
1297 VG_(sigdelset)(&VG_(threads)[tid].sig_mask, VKI_SIGKILL); in do_setmask()
1298 VG_(sigdelset)(&VG_(threads)[tid].sig_mask, VKI_SIGSTOP); in do_setmask()
1299 VG_(threads)[tid].tmp_sig_mask = VG_(threads)[tid].sig_mask; in do_setmask()
1304 SysRes VG_(do_sys_sigprocmask) ( ThreadId tid, in VG_()
1313 vg_assert(VG_(is_valid_tid)(tid)); in VG_()
1314 do_setmask ( tid, how, set, oldset ); in VG_()
1351 void VG_(clear_out_queued_signals)( ThreadId tid, vki_sigset_t* saved_mask ) in VG_()
1354 if (VG_(threads)[tid].sig_queue != NULL) { in VG_()
1355 VG_(free)(VG_(threads)[tid].sig_queue); in VG_()
1356 VG_(threads)[tid].sig_queue = NULL; in VG_()
1369 void push_signal_frame ( ThreadId tid, const vki_siginfo_t *siginfo, in push_signal_frame() argument
1377 vg_assert(VG_(is_valid_tid)(tid)); in push_signal_frame()
1378 tst = & VG_(threads)[tid]; in push_signal_frame()
1381 VG_(dmsg)("push_signal_frame (thread %d): signal %d\n", tid, sigNo); in push_signal_frame()
1382 VG_(get_and_pp_StackTrace)(tid, 10); in push_signal_frame()
1390 sas_ss_flags(tid, VG_(get_SP)(tid)) == 0 in push_signal_frame()
1397 sigNo, VG_(signame)(sigNo), tid, tst->altstack.ss_sp, in push_signal_frame()
1402 VG_TRACK( pre_deliver_signal, tid, sigNo, /*alt_stack*/True ); in push_signal_frame()
1405 esp_top_of_frame = VG_(get_SP)(tid) - VG_STACK_REDZONE_SZB; in push_signal_frame()
1408 VG_TRACK( pre_deliver_signal, tid, sigNo, /*alt_stack*/False ); in push_signal_frame()
1417 VG_(sigframe_create) (tid, esp_top_of_frame, siginfo, uc, in push_signal_frame()
1518 static Bool is_signal_from_kernel(ThreadId tid, int signum, int si_code) in is_signal_from_kernel() argument
1542 if (VG_(threads)[tid].status == VgTs_WaitSys) { in is_signal_from_kernel()
1574 static void default_action(const vki_siginfo_t *info, ThreadId tid) in default_action() argument
1582 vg_assert(VG_(is_running_thread)(tid)); in default_action()
1643 (could_core && is_signal_from_kernel(tid, sigNo, info->si_code)) in default_action()
1652 if (is_signal_from_kernel(tid, sigNo, info->si_code)) { in default_action()
1728 if (VG_(is_valid_tid)(tid)) { in default_action()
1739 if (tid == 1) { // main thread in default_action()
1740 Addr esp = VG_(get_SP)(tid); in default_action()
1743 VG_(extend_stack)(tid, base)) { in default_action()
1765 (VG_(get_SP)(tid), sizeof(Addr), VKI_PROT_READ) in default_action()
1766 ? VG_(record_ExeContext)( tid, first_ip_delta ) in default_action()
1767 : VG_(record_depth_1_ExeContext)( tid, in default_action()
1773 && is_signal_from_kernel(tid, sigNo, info->si_code) in default_action()
1792 VG_(gdbserver_report_fatal_signal) (info, tid); in default_action()
1796 VG_(start_debugger)( tid ); in default_action()
1802 VG_(make_coredump)(tid, info, corelim.rlim_cur); in default_action()
1814 VG_(nuke_all_threads_except)(tid, VgSrc_FatalSig); in default_action()
1815 VG_(threads)[tid].exitreason = VgSrc_FatalSig; in default_action()
1816 VG_(threads)[tid].os_state.fatalsig = sigNo; in default_action()
1827 static void deliver_signal ( ThreadId tid, const vki_siginfo_t *info, in deliver_signal() argument
1833 ThreadState *tst = VG_(get_ThreadState)(tid); in deliver_signal()
1837 sigNo, VG_(signame)(sigNo), info->si_code, tid ); in deliver_signal()
1844 vg_assert(VG_(is_exiting)(tid)); in deliver_signal()
1861 default_action(info, tid); in deliver_signal()
1873 vg_assert(VG_(is_valid_tid)(tid)); in deliver_signal()
1875 push_signal_frame ( tid, info, uc ); in deliver_signal()
1902 static void resume_scheduler(ThreadId tid) in resume_scheduler() argument
1904 ThreadState *tst = VG_(get_ThreadState)(tid); in resume_scheduler()
1915 static void synth_fault_common(ThreadId tid, Addr addr, Int si_code) in synth_fault_common() argument
1919 vg_assert(VG_(threads)[tid].status == VgTs_Runnable); in synth_fault_common()
1928 (void) VG_(gdbserver_report_signal) (&info, tid); in synth_fault_common()
1931 if (VG_(sigismember)(&VG_(threads)[tid].sig_mask, VKI_SIGSEGV)) in synth_fault_common()
1934 deliver_signal(tid, &info, NULL); in synth_fault_common()
1939 void VG_(synth_fault_perms)(ThreadId tid, Addr addr) in VG_()
1941 synth_fault_common(tid, addr, VKI_SEGV_ACCERR); in VG_()
1945 void VG_(synth_fault_mapping)(ThreadId tid, Addr addr) in VG_()
1947 synth_fault_common(tid, addr, VKI_SEGV_MAPERR); in VG_()
1951 void VG_(synth_fault)(ThreadId tid) in VG_()
1953 synth_fault_common(tid, 0, VKI_SEGV_MADE_UP_GPF); in VG_()
1957 void VG_(synth_sigill)(ThreadId tid, Addr addr) in VG_()
1961 vg_assert(VG_(threads)[tid].status == VgTs_Runnable); in VG_()
1968 if (VG_(gdbserver_report_signal) (&info, tid)) { in VG_()
1969 resume_scheduler(tid); in VG_()
1970 deliver_signal(tid, &info, NULL); in VG_()
1973 resume_scheduler(tid); in VG_()
1977 void VG_(synth_sigbus)(ThreadId tid) in VG_()
1981 vg_assert(VG_(threads)[tid].status == VgTs_Runnable); in VG_()
1993 if (VG_(gdbserver_report_signal) (&info, tid)) { in VG_()
1994 resume_scheduler(tid); in VG_()
1995 deliver_signal(tid, &info, NULL); in VG_()
1998 resume_scheduler(tid); in VG_()
2002 void VG_(synth_sigtrap)(ThreadId tid) in VG_()
2012 vg_assert(VG_(threads)[tid].status == VgTs_Runnable); in VG_()
2033 if (VG_(gdbserver_report_signal) (&info, tid)) { in VG_()
2034 resume_scheduler(tid); in VG_()
2035 deliver_signal(tid, &info, &uc); in VG_()
2038 resume_scheduler(tid); in VG_()
2042 void VG_(synth_sigfpe)(ThreadId tid, UInt code) in VG_()
2051 vg_assert(VG_(threads)[tid].status == VgTs_Runnable); in VG_()
2058 if (VG_(gdbserver_report_signal) (VKI_SIGFPE, tid)) { in VG_()
2059 resume_scheduler(tid); in VG_()
2060 deliver_signal(tid, &info, &uc); in VG_()
2063 resume_scheduler(tid); in VG_()
2075 void queue_signal(ThreadId tid, const vki_siginfo_t *si) in queue_signal() argument
2081 tst = VG_(get_ThreadState)(tid); in queue_signal()
2094 si->si_signo, sq->next, tid); in queue_signal()
2104 sq->sigs[sq->next].si_signo, tid); in queue_signal()
2120 static vki_siginfo_t *next_queued(ThreadId tid, const vki_sigset_t *set) in next_queued() argument
2122 ThreadState *tst = VG_(get_ThreadState)(tid); in next_queued()
2142 sq->sigs[idx].si_signo, idx, tid); in next_queued()
2182 ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)()); in async_signalhandler() local
2183 ThreadState* tst = VG_(get_ThreadState)(tid); in async_signalhandler()
2188 VG_(acquire_BigLock)(tid, "async_signalhandler"); in async_signalhandler()
2194 sigNo, tid, info->si_code); in async_signalhandler()
2234 tid, in async_signalhandler()
2242 if (!is_sig_ign(info, tid)) in async_signalhandler()
2243 deliver_signal(tid, info, uc); in async_signalhandler()
2260 resume_scheduler(tid); in async_signalhandler()
2279 Bool VG_(extend_stack)(ThreadId tid, Addr addr) in VG_()
2309 tid, new_stack_base); in VG_()
2312 "to %#lx\n", tid, new_stack_base); in VG_()
2339 void sync_signalhandler_from_user ( ThreadId tid, in sync_signalhandler_from_user() argument
2348 if (VG_(threads)[tid].status == VgTs_WaitSys) { in sync_signalhandler_from_user()
2398 deliver_signal(tid, info, uc); in sync_signalhandler_from_user()
2399 resume_scheduler(tid); in sync_signalhandler_from_user()
2407 qtid = tid; /* directed to us specifically */ in sync_signalhandler_from_user()
2429 static Bool extend_stack_if_appropriate(ThreadId tid, vki_siginfo_t* info) in extend_stack_if_appropriate() argument
2439 esp = VG_(get_SP)(tid); in extend_stack_if_appropriate()
2448 info->si_code, fault, tid, esp); in extend_stack_if_appropriate()
2452 info->si_code, fault, tid, esp, seg->start, seg->end); in extend_stack_if_appropriate()
2469 VG_(extend_stack)(tid, base)) { in extend_stack_if_appropriate()
2483 void sync_signalhandler_from_kernel ( ThreadId tid, in sync_signalhandler_from_kernel() argument
2498 if (extend_stack_if_appropriate(tid, info)) { in sync_signalhandler_from_kernel()
2506 ThreadState *tst = VG_(get_ThreadState)(tid); in sync_signalhandler_from_kernel()
2514 if (VG_(gdbserver_report_signal) (info, tid) in sync_signalhandler_from_kernel()
2518 deliver_signal(tid, info, uc); in sync_signalhandler_from_kernel()
2519 resume_scheduler(tid); in sync_signalhandler_from_kernel()
2522 resume_scheduler(tid); in sync_signalhandler_from_kernel()
2543 vg_assert(tid != 0); in sync_signalhandler_from_kernel()
2560 ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)()); in sync_signalhandler() local
2576 from_user = !is_signal_from_kernel(tid, sigNo, info->si_code); in sync_signalhandler()
2581 sigNo, info->si_code, VG_(get_IP)(tid), in sync_signalhandler()
2604 sync_signalhandler_from_user( tid, sigNo, info, uc); in sync_signalhandler()
2606 sync_signalhandler_from_kernel(tid, sigNo, info, uc); in sync_signalhandler()
2619 ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)()); in sigvgkill_handler() local
2620 ThreadStatus at_signal = VG_(threads)[tid].status; in sigvgkill_handler()
2623 VG_(dmsg)("sigvgkill for lwp %d tid %d\n", VG_(gettid)(), tid); in sigvgkill_handler()
2625 VG_(acquire_BigLock)(tid, "sigvgkill_handler"); in sigvgkill_handler()
2641 VG_(post_syscall)(tid); in sigvgkill_handler()
2644 resume_scheduler(tid); in sigvgkill_handler()
2689 void VG_(poll_signals)(ThreadId tid) in VG_()
2693 ThreadState *tst = VG_(get_ThreadState)(tid); in VG_()
2703 sip = next_queued(tid, &pollset); /* this thread */ in VG_()
2712 si.si_signo, tid); in VG_()
2719 VG_(dmsg)("Polling found signal %d for tid %d\n", sip->si_signo, tid); in VG_()
2720 if (!is_sig_ign(sip, tid)) in VG_()
2721 deliver_signal(tid, sip, NULL); in VG_()