Lines Matching refs:task

91   task_t task = TaskPort();
92 err = ::task_suspend(task);
94 err.LogThreaded("::task_suspend ( target_task = 0x%4.4x )", task);
103 task_t task = TaskPort();
104 if (task == TASK_NULL)
108 err = BasicInfo(task, &task_info);
112 err = ::task_resume(task);
115 "( target_task = 0x%4.4x )", task);
120 // task is not suspended, don't try and resume it since it is already
123 err = ::task_resume(task);
125 err.LogThreaded("::task_resume ( target_task = 0x%4.4x )", task);
147 // Do any cleanup needed for this task
174 task_t task = TaskPort();
175 if (task != TASK_NULL) {
176 n = m_vm_memory.Read(task, addr, buf, size);
197 task_t task = TaskPort();
198 if (task != TASK_NULL) {
199 n = m_vm_memory.Write(task, addr, buf, size);
217 task_t task = TaskPort();
218 if (task == TASK_NULL)
221 int ret = m_vm_memory.GetMemoryRegionInfo(task, addr, region_info);
238 task_t task, nub_process_t pid,
246 kr = task_threads(task, &threads, &tcnt);
323 task_t task = TaskPort();
324 if (task == TASK_NULL)
331 err = BasicInfo(task, &task_info);
361 get_threads_profile_data(scanType, task, pid, threads_id, threads_name,
370 if (m_vm_memory.GetMemoryProfile(scanType, task, task_info,
454 pm_sample_task_and_pid(task, pid, &pm_energy, now,
513 task_t task = TASK_NULL;
516 err = ::task_for_pid(task_self, pid, &task);
521 "pid = %d, &task ) => err = 0x%8.8x (%s)",
537 return task;
557 kern_return_t MachTask::BasicInfo(task_t task, struct task_basic_info *info) {
563 err = ::task_info(task, TASK_BASIC_INFO, (task_info_t)info, &count);
569 task, info, count);
588 // Returns true if a task is a valid task port for a current process.
595 // Returns true if a task is a valid task port for a current process.
597 bool MachTask::IsValid(task_t task) {
598 if (task != TASK_NULL) {
600 return BasicInfo(task, &task_info) == KERN_SUCCESS;
610 task_t task = TaskPortForProcessID(err);
611 if (MachTask::IsValid(task)) {
643 task, m_exc_port_info.mask, m_exception_port,
646 err.LogThreaded("::task_set_exception_ports ( task = 0x%4.4x, "
649 task, m_exc_port_info.mask, m_exception_port,
662 DNBLogError("MachTask::%s (): task invalid, exception thread start failed.",
690 err.LogThreaded("::mach_port_deallocate ( task = 0x%4.4x, name = 0x%4.4x )",
740 task_t task = mach_task->TaskPort();
796 // to get all currently available exceptions for this task
815 // If we have no task port we should exit this thread
821 // Make sure our task is still valid
822 if (MachTask::IsValid(task)) {
825 "interrupted, but task still valid, continuing...");
828 DNBLogThreadedIf(LOG_EXCEPTIONS, "task has exited...");
830 // Our task has died, exit the thread.
840 // bundle available and get the possibly updated task port back
841 // from the process in case we exec'ed and our task port changed
842 task = mach_proc->ExceptionMessageBundleComplete();
845 // Make sure our task is still valid
846 if (MachTask::IsValid(task)) {
851 DNBLogThreadedIf(LOG_EXCEPTIONS, "task has exited...");
853 // Our task has died, exit the thread.
875 if (exception_message.CatchExceptionRaise(task)) {
876 if (exception_message.state.task_port != task) {
878 // We exec'ed and our task port changed on us.
880 "task port changed from 0x%4.4x to 0x%4.4x",
881 task, exception_message.state.task_port);
882 task = exception_message.state.task_port;
934 task_t task = TaskPortForProcessID(err);
936 err = ::task_info(task, TASK_DYLD_INFO, (task_info_t)&dyld_info, &count);
950 task_t task = TaskPort();
951 if (task == TASK_NULL)
955 err = ::mach_vm_allocate(task, &addr, size, TRUE);
966 err = ::mach_vm_protect(task, addr, size, 0, mach_prot);
971 ::mach_vm_deallocate(task, addr, size);
980 task_t task = TaskPort();
981 if (task == TASK_NULL)
993 ::mach_vm_protect(task, addr, size, 0, VM_PROT_NONE);
996 return ::mach_vm_deallocate(task, addr, size) == KERN_SUCCESS;
1009 void MachTask::TaskPortChanged(task_t task)
1011 m_task = task;