Lines Matching refs:pid
153 int csops(pid_t pid, unsigned int ops, void *useraddr, size_t usersize);
156 bool rootless_allows_task_for_pid(pid_t pid);
506 nub_process_t pid = m_ctx.ProcessID(); in FlushSTDIO() local
510 count = DNBProcessGetAvailableSTDOUT(pid, buf, sizeof(buf)); in FlushSTDIO()
517 count = DNBProcessGetAvailableSTDERR(pid, buf, sizeof(buf)); in FlushSTDIO()
527 nub_process_t pid = m_ctx.ProcessID(); in SendAsyncProfileData() local
531 count = DNBProcessGetAvailableProfileData(pid, buf, sizeof(buf)); in SendAsyncProfileData()
1316 pid_t pid = m_ctx.ProcessID(); in InitializeRegisters() local
1317 if (pid == INVALID_NUB_PROCESS) in InitializeRegisters()
1616 nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_qThreadInfo() local
1617 if (pid == INVALID_NUB_PROCESS) in HandlePacket_qThreadInfo()
1623 nub_size_t numthreads = DNBProcessGetNumThreads(pid); in HandlePacket_qThreadInfo()
1632 nub_thread_t th = DNBProcessGetThreadAtIndex(pid, i); in HandlePacket_qThreadInfo()
1645 nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_qThreadExtraInfo() local
1646 if (pid == INVALID_NUB_PROCESS) in HandlePacket_qThreadExtraInfo()
1665 const char *threadInfo = DNBThreadGetInfo(pid, tid); in HandlePacket_qThreadExtraInfo()
1809 nub_process_t pid; in HandlePacket_qGetPid() local
1814 pid = m_ctx.ProcessID(); in HandlePacket_qGetPid()
1816 pid = 0; in HandlePacket_qGetPid()
1817 rep << std::hex << pid; in HandlePacket_qGetPid()
2564 void register_value_in_hex_fixed_width(std::ostream &ostrm, nub_process_t pid, in register_value_in_hex_fixed_width() argument
2571 if (DNBThreadGetRegisterValueByID(pid, tid, reg->nub_info.set, in register_value_in_hex_fixed_width()
2592 std::ostream &ostrm, nub_process_t pid, nub_thread_t tid, in debugserver_regnum_with_fixed_width_hex_register_value() argument
2599 register_value_in_hex_fixed_width(ostrm, pid, tid, reg, reg_value_ptr); in debugserver_regnum_with_fixed_width_hex_register_value()
2605 nub_process_t pid, nub_addr_t dispatch_qaddr, nub_addr_t &dispatch_queue_t, in GetThreadQueueInfo() argument
2614 dispatch_queue_t = DNBProcessMemoryReadPointer(pid, dispatch_qaddr); in GetThreadQueueInfo()
2617 pid, dispatch_queue_t + dqo_width, dqo_width_size, 0); in GetThreadQueueInfo()
2619 pid, dispatch_queue_t + dqo_serialnum, dqo_serialnum_size, 0); in GetThreadQueueInfo()
2626 DNBProcessMemoryReadPointer(pid, pointer_to_label_address); in GetThreadQueueInfo()
2628 queue_name = DNBProcessMemoryReadCString(pid, label_addr); in GetThreadQueueInfo()
2633 pid, dispatch_queue_t + dqo_label, dqo_label_size); in GetThreadQueueInfo()
2645 static void ReadStackMemory(nub_process_t pid, nub_thread_t tid, in ReadStackMemory() argument
2649 if (DNBThreadGetRegisterValueByID(pid, tid, REGISTER_SET_GENERIC, in ReadStackMemory()
2667 if (DNBProcessMemoryRead(pid, fp, read_size, stack_memory.bytes) != in ReadStackMemory()
2685 const nub_process_t pid = m_ctx.ProcessID(); in SendStopReplyPacketForThread() local
2686 if (pid == INVALID_NUB_PROCESS) in SendStopReplyPacketForThread()
2694 if (DNBThreadGetStopReason(pid, tid, &tid_stop_info)) { in SendStopReplyPacketForThread()
2747 const char *thread_name = DNBThreadGetName(pid, tid); in SendStopReplyPacketForThread()
2772 const nub_size_t numthreads = DNBProcessGetNumThreads(pid); in SendStopReplyPacketForThread()
2777 nub_thread_t th = DNBProcessGetThreadAtIndex(pid, i); in SendStopReplyPacketForThread()
2782 if (DNBThreadGetRegisterValueByID(pid, th, REGISTER_SET_GENERIC, in SendStopReplyPacketForThread()
2847 pid, tid, g_reg_entries[reg].nub_info.set, in SendStopReplyPacketForThread()
2852 ostrm, pid, tid, &g_reg_entries[reg], ®_value); in SendStopReplyPacketForThread()
2874 ReadStackMemory(pid, tid, stack_mmap, 2); in SendStopReplyPacketForThread()
2899 nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_last_signal() local
2900 nub_state_t pid_state = DNBProcessGetState(pid); in HandlePacket_last_signal()
2913 nub_thread_t tid = DNBProcessGetCurrentThread(pid); in HandlePacket_last_signal()
2927 if (!DNBProcessGetExitStatus(pid, &pid_status)) in HandlePacket_last_signal()
2948 const char *exit_info = DNBProcessGetExitInfo(pid); in HandlePacket_last_signal()
3233 nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_g() local
3240 nub_size_t reg_ctx_size = DNBThreadGetRegisterContext(pid, tid, NULL, 0); in HandlePacket_g()
3247 DNBThreadGetRegisterContext(pid, tid, ®_ctx[0], reg_ctx.size()); in HandlePacket_g()
3271 nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_G() local
3278 nub_size_t reg_ctx_size = DNBThreadGetRegisterContext(pid, tid, NULL, 0); in HandlePacket_G()
3289 DNBThreadSetRegisterContext(pid, tid, reg_ctx.data(), reg_ctx.size()); in HandlePacket_G()
3406 nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_SaveRegisterState() local
3419 const uint32_t save_id = DNBThreadSaveRegisterState(pid, tid); in HandlePacket_SaveRegisterState()
3447 nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_RestoreRegisterState() local
3466 if (DNBThreadRestoreRegisterState(pid, tid, save_id)) in HandlePacket_RestoreRegisterState()
3526 static bool process_does_not_exist (nub_process_t pid) { in process_does_not_exist() argument
3531 if (proc_infos[i].kp_proc.p_pid == pid) in process_does_not_exist()
3546 static bool attach_failed_due_to_uid_mismatch (nub_process_t pid, in attach_failed_due_to_uid_mismatch() argument
3550 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}; in attach_failed_due_to_uid_mismatch()
3573 static bool process_is_already_being_debugged (nub_process_t pid) { in process_is_already_being_debugged() argument
3575 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}; in process_is_already_being_debugged()
4016 nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_z() local
4043 if (DNBBreakpointSet(pid, addr, byte_size, hardware)) { in HandlePacket_z()
4067 if (DNBWatchpointSet(pid, addr, byte_size, watch_flags, hardware)) { in HandlePacket_z()
4083 if (DNBBreakpointClear(pid, addr)) { in HandlePacket_z()
4093 if (DNBWatchpointClear(pid, addr)) { in HandlePacket_z()
4140 nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_p() local
4173 register_value_in_hex_fixed_width(ostrm, pid, tid, reg_entry, NULL); in HandlePacket_p()
4193 nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_P() local
4236 if (!DNBThreadSetRegisterValueByID(pid, tid, reg_entry->nub_info.set, in HandlePacket_P()
4247 const nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_c() local
4249 if (pid == INVALID_NUB_PROCESS) in HandlePacket_c()
4267 if (!DNBProcessResume(pid, thread_actions.GetFirst(), in HandlePacket_c()
4365 nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_GetProfileData() local
4366 if (pid == INVALID_NUB_PROCESS) in HandlePacket_GetProfileData()
4383 std::string data = DNBProcessGetProfileData(pid, scan_type); in HandlePacket_GetProfileData()
4393 nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_SetEnableAsyncProfiling() local
4394 if (pid == INVALID_NUB_PROCESS) in HandlePacket_SetEnableAsyncProfiling()
4421 DNBProcessSetEnableAsyncProfiling(pid, enable, interval_usec, scan_type); in HandlePacket_SetEnableAsyncProfiling()
4521 const nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_C() local
4523 if (pid == INVALID_NUB_PROCESS) in HandlePacket_C()
4549 if (!DNBProcessSignal(pid, process_signo)) in HandlePacket_C()
4551 if (!DNBProcessResume(pid, thread_actions.GetFirst(), in HandlePacket_C()
4611 const nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_s() local
4612 if (pid == INVALID_NUB_PROCESS) in HandlePacket_s()
4628 if (!DNBProcessResume(pid, thread_actions.GetFirst(), in HandlePacket_s()
4639 const nub_process_t pid = m_ctx.ProcessID(); in HandlePacket_S() local
4640 if (pid == INVALID_NUB_PROCESS) in HandlePacket_S()
4667 nub_state_t tstate = DNBThreadGetState(pid, action.tid); in HandlePacket_S()
4676 if (!DNBProcessResume(pid, thread_actions.GetFirst(), in HandlePacket_S()
5423 nub_process_t pid = m_ctx.ProcessID(); in GetJSONThreadsInfo() local
5425 nub_size_t numthreads = DNBProcessGetNumThreads(pid); in GetJSONThreadsInfo()
5427 nub_thread_t tid = DNBProcessGetThreadAtIndex(pid, i); in GetJSONThreadsInfo()
5432 DNBThreadGetStopReason(pid, tid, &tid_stop_info); in GetJSONThreadsInfo()
5485 const char *thread_name = DNBThreadGetName(pid, tid); in GetJSONThreadsInfo()
5490 if (DNBThreadGetIdentifierInfo(pid, tid, &thread_ident_info)) { in GetJSONThreadsInfo()
5503 pid, thread_ident_info.dispatch_qaddr, dispatch_queue_t, in GetJSONThreadsInfo()
5541 pid, tid, g_reg_entries[reg].nub_info.set, in GetJSONThreadsInfo()
5560 ReadStackMemory(pid, tid, stack_mmap); in GetJSONThreadsInfo()
5604 nub_process_t pid; in HandlePacket_jThreadExtendedInfo() local
5611 pid = m_ctx.ProcessID(); in HandlePacket_jThreadExtendedInfo()
5632 nub_addr_t pthread_t_value = DNBGetPThreadT(pid, tid); in HandlePacket_jThreadExtendedInfo()
5639 pid, tid, plo_pthread_tsd_base_address_offset, in HandlePacket_jThreadExtendedInfo()
5661 thread_activity_sp = DNBGetGenealogyInfoForThread(pid, tid, timed_out); in HandlePacket_jThreadExtendedInfo()
5765 image_info_sp = DNBGetGenealogyImageInfo(pid, idx); in HandlePacket_jThreadExtendedInfo()
5818 pid, tid, tsd_address, dti_qos_class_index); in HandlePacket_jThreadExtendedInfo()
5843 nub_addr_t dispatch_queue_t_value = DNBGetDispatchQueueT(pid, tid); in HandlePacket_jThreadExtendedInfo()
5878 nub_process_t pid; in HandlePacket_jGetLoadedDynamicLibrariesInfos() local
5884 pid = m_ctx.ProcessID(); in HandlePacket_jGetLoadedDynamicLibrariesInfos()
5899 json_sp = DNBGetAllLoadedLibrariesInfos(pid); in HandlePacket_jGetLoadedDynamicLibrariesInfos()
5902 json_sp = DNBGetLibrariesInfoForAddresses(pid, macho_addresses); in HandlePacket_jGetLoadedDynamicLibrariesInfos()
5911 json_sp = DNBGetLoadedDynamicLibrariesInfos(pid, image_list_address, in HandlePacket_jGetLoadedDynamicLibrariesInfos()
5936 nub_process_t pid; in HandlePacket_jGetSharedCacheInfo() local
5942 pid = m_ctx.ProcessID(); in HandlePacket_jGetSharedCacheInfo()
5947 JSONGenerator::ObjectSP json_sp = DNBGetSharedCacheInfo(pid); in HandlePacket_jGetSharedCacheInfo()
5963 static bool MachHeaderIsMainExecutable(nub_process_t pid, uint32_t addr_size, in MachHeaderIsMainExecutable() argument
5969 pid, addr_size, mach_header_addr); in MachHeaderIsMainExecutable()
5971 DNBProcessMemoryRead(pid, mach_header_addr, sizeof(mh), &mh); in MachHeaderIsMainExecutable()
5979 pid, addr_size, mach_header_addr, mh.magic, mh.cputype, mh.cpusubtype, in MachHeaderIsMainExecutable()
5988 pid, addr_size, mach_header_addr); in MachHeaderIsMainExecutable()
5996 static nub_addr_t GetMachHeaderForMainExecutable(const nub_process_t pid, in GetMachHeaderForMainExecutable() argument
6007 const nub_addr_t shlib_addr = DNBProcessGetSharedLibraryInfoAddress(pid); in GetMachHeaderForMainExecutable()
6019 if (DNBProcessGetNumThreads(pid) == 1) { in GetMachHeaderForMainExecutable()
6020 nub_thread_t tid = DNBProcessGetThreadAtIndex(pid, 0); in GetMachHeaderForMainExecutable()
6023 if (DNBThreadGetRegisterValueByID(pid, tid, REGISTER_SET_GENERIC, in GetMachHeaderForMainExecutable()
6027 bytes_read = DNBProcessMemoryRead(pid, sp, addr_size, bytes); in GetMachHeaderForMainExecutable()
6031 if (MachHeaderIsMainExecutable(pid, addr_size, mach_header_addr, mh)) in GetMachHeaderForMainExecutable()
6042 DNBProcessMemoryRead(pid, shlib_addr, sizeof(AllImageInfos), bytes); in GetMachHeaderForMainExecutable()
6053 bytes_read = DNBProcessMemoryRead(pid, aii.dylib_info_addr + in GetMachHeaderForMainExecutable()
6060 if (MachHeaderIsMainExecutable(pid, addr_size, mach_header_addr, in GetMachHeaderForMainExecutable()
6075 while (DNBProcessMemoryRegionInfo(pid, mach_header_addr, ®ion_info)) { in GetMachHeaderForMainExecutable()
6087 if (MachHeaderIsMainExecutable(pid, addr_size, mach_header_addr, mh)) in GetMachHeaderForMainExecutable()
6162 nub_process_t pid; in HandlePacket_qProcessInfo() local
6169 pid = m_ctx.ProcessID(); in HandlePacket_qProcessInfo()
6171 rep << "pid:" << std::hex << pid << ';'; in HandlePacket_qProcessInfo()
6177 procpid_mib[3] = pid; in HandlePacket_qProcessInfo()
6196 cpu_type_t cputype = DNBProcessGetCPUType(pid); in HandlePacket_qProcessInfo()
6266 GetMachHeaderForMainExecutable(pid, addr_size, mh); in HandlePacket_qProcessInfo()
6274 DNBProcessMemoryRead(pid, load_command_addr, sizeof(lc), &lc); in HandlePacket_qProcessInfo()
6280 DNBGetDeploymentInfo(pid, is_executable, lc, load_command_addr, in HandlePacket_qProcessInfo()
6317 int proc_args_mib[3] = {CTL_KERN, KERN_PROCARGS2, (int)pid}; in HandlePacket_qProcessInfo()
6383 nub_thread_t thread = DNBProcessGetCurrentThreadMachPort(pid); in HandlePacket_qProcessInfo()
6399 nub_thread_t thread = DNBProcessGetCurrentThreadMachPort(pid); in HandlePacket_qProcessInfo()
6421 nub_process_t pid = m_ctx.ProcessID(); in GetDispatchQueueOffsets() local
6423 pid, m_dispatch_queue_offsets_addr, sizeof(m_dispatch_queue_offsets), in GetDispatchQueueOffsets()