Lines Matching refs:vg_tid
159 static inline uintptr_t GetVgPc(ThreadId vg_tid) {
160 Addr pc = VG_(threads)[vg_tid].arch.vex.VG_INSTR_PTR;
161 DCHECK(pc == VG_(get_IP)(vg_tid));
163 //return (uintptr_t)VG_(get_IP)(vg_tid);
166 static inline uintptr_t GetVgSp(ThreadId vg_tid) {
167 Addr sp = VG_(threads)[vg_tid].arch.vex.VG_STACK_PTR;
168 DCHECK(sp == VG_(get_SP)(vg_tid));
173 static inline uintptr_t GetVgLr(ThreadId vg_tid) {
174 return (uintptr_t)VG_(threads)[vg_tid].arch.vex.guest_R14;
254 static int32_t VgTidToTsTid(ThreadId vg_tid) {
255 DCHECK(vg_tid < VG_N_THREADS);
256 DCHECK(vg_tid >= 1);
258 DCHECK(g_valgrind_threads[vg_tid].zero_based_uniq_tid >= 0);
259 return g_valgrind_threads[vg_tid].zero_based_uniq_tid;
348 static void OnStartClientCode(ThreadId vg_tid, ULong nDisp) {
349 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
410 ThreadId vg_tid = GetVgTid();
411 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
418 UpdateCallStack(thr, GetVgSp(vg_tid));
441 ThreadId vg_tid = GetVgTid();
442 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
449 record.lr = GetVgLr(vg_tid);
455 uintptr_t call_pc = GetVgPc(vg_tid);
491 ThreadId vg_tid = GetVgTid();
492 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
495 int32_t ts_tid = VgTidToTsTid(vg_tid);
533 void evh__pre_workq_task_start(ThreadId vg_tid, Addr workitem) {
534 uintptr_t pc = GetVgPc(vg_tid);
535 int32_t ts_tid = VgTidToTsTid(vg_tid);
536 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
541 void evh__pre_thread_first_insn(const ThreadId vg_tid) {
542 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
544 Put(THR_FIRST_INSN, VgTidToTsTid(vg_tid), GetVgPc(vg_tid), 0, 0);
563 static inline Bool ignoring_sync(ThreadId vg_tid, uintptr_t addr) {
566 return (g_valgrind_threads[vg_tid].ignore_sync &&
567 !g_valgrind_threads[vg_tid].in_signal_handler) ||
571 Bool ts_handle_client_request(ThreadId vg_tid, UWord* args, UWord* ret) {
583 int32_t ts_tid = VgTidToTsTid(vg_tid);
593 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
595 UpdateCallStack(thr, GetVgSp(vg_tid));
597 uintptr_t pc = GetVgPc(vg_tid);
699 g_valgrind_threads[vg_tid].ignore_accesses++;
702 g_valgrind_threads[vg_tid].ignore_accesses--;
703 CHECK(g_valgrind_threads[vg_tid].ignore_accesses >= 0);
706 g_valgrind_threads[vg_tid].ignore_sync++;
709 g_valgrind_threads[vg_tid].ignore_sync--;
710 CHECK(g_valgrind_threads[vg_tid].ignore_sync >= 0);
724 if (ignoring_sync(vg_tid, args[1]))
729 if (ignoring_sync(vg_tid, args[1]))
734 if (ignoring_sync(vg_tid, args[1]))
739 if (ignoring_sync(vg_tid, args[1]))
750 if (ignoring_sync(vg_tid, args[1]))
755 if (ignoring_sync(vg_tid, args[1]))
774 *ret = vg_tid;
789 static void SignalIn(ThreadId vg_tid, Int sigNo, Bool alt_stack) {
790 g_valgrind_threads[vg_tid].in_signal_handler++;
791 DCHECK(g_valgrind_threads[vg_tid].in_signal_handler == 1);
792 // int32_t ts_tid = VgTidToTsTid(vg_tid);
796 static void SignalOut(ThreadId vg_tid, Int sigNo) {
797 g_valgrind_threads[vg_tid].in_signal_handler--;
798 CHECK(g_valgrind_threads[vg_tid].in_signal_handler >= 0);
799 DCHECK(g_valgrind_threads[vg_tid].in_signal_handler == 0);
800 // int32_t ts_tid = VgTidToTsTid(vg_tid);
835 ThreadId vg_tid = GetVgTid();
838 ValgrindThread *thr = &g_valgrind_threads[vg_tid];
897 ThreadId vg_tid = GetVgTid();
898 ValgrindThread *thr = &g_valgrind_threads[vg_tid];