Lines Matching refs:pid

76 AddProcessToMap (nub_process_t pid, MachProcessSP& procSP)
81 process_map->insert(std::make_pair(pid, procSP));
93 RemoveProcessFromMap (nub_process_t pid)
98 return process_map->erase(pid);
110 GetProcessSP (nub_process_t pid, MachProcessSP& procSP)
115 ProcessMapIter pos = process_map->find(pid);
130 const pid_t pid = (pid_t)(intptr_t)arg;
134 pid_t child_pid = waitpid(pid, &status, 0);
135 DNBLogThreadedIf(LOG_PROCESS, "waitpid_thread (): waitpid (pid = %i, &status, 0) => %i, status = %i, errno = %i", pid, child_pid, status, errno);
151 DNBLogThreadedIf(LOG_PROCESS, "waitpid_thread (): setting exit status for pid = %i to %i", child_pid, status);
160 DNBLogThreadedIf(LOG_PROCESS, "waitpid_thread (): main loop exited, setting exit status to an invalid value (-1) for pid %i", pid);
161 DNBProcessSetExitStatus (pid, -1);
166 spawn_waitpid_thread (pid_t pid)
169 ::pthread_create (&thread, NULL, waitpid_thread, (void *)(intptr_t)pid);
222 pid_t pid = processSP->LaunchForDebug (path,
247 DNBLogThreadedIf(LOG_PROCESS, "(DebugNub) new pid is %d...", pid);
249 if (pid != INVALID_NUB_PROCESS)
252 spawn_waitpid_thread (pid);
260 kill (SIGKILL, pid);
266 ::snprintf (err_str, err_len, "failed to get the task for process %i (%s)", pid, launch_err.AsString());
270 ::snprintf (err_str, err_len, "failed to get the task for process %i", pid);
276 bool res = AddProcessToMap(pid, processSP);
278 return pid;
315 pid_t pid = INVALID_NUB_PROCESS;
319 DNBLogThreadedIf(LOG_PROCESS, "(DebugNub) attaching to pid %d...", attach_pid);
320 pid = processSP->AttachForDebug (attach_pid, err_str, err_len);
322 if (pid != INVALID_NUB_PROCESS)
324 bool res = AddProcessToMap(pid, processSP);
326 spawn_waitpid_thread(pid);
330 while (pid != INVALID_NUB_PROCESS)
336 pid);
337 nub_event_t set_events = DNBProcessWaitForEvents (pid,
345 pid,
352 pid = INVALID_NUB_PROCESS;
358 nub_state_t pid_state = DNBProcessGetState (pid);
360 __FUNCTION__, pid, DNBStateAsString(pid_state));
379 return pid;
389 DNBProcessResetEvents(pid, set_events);
562 nub_process_t pid;
563 pid = MachProcess::CheckForProcess(attach_token);
564 if (pid != INVALID_NUB_PROCESS)
566 waitfor_pid = pid;
636 DNBLogThreadedIf (LOG_PROCESS, "Attaching to %s with pid %i...\n", waitfor_process_name, waitfor_pid);
647 DNBProcessDetach (nub_process_t pid)
650 if (GetProcessSP (pid, procSP))
658 DNBProcessKill (nub_process_t pid)
661 if (GetProcessSP (pid, procSP))
669 DNBProcessSignal (nub_process_t pid, int signal)
672 if (GetProcessSP (pid, procSP))
681 DNBProcessIsAlive (nub_process_t pid)
684 if (GetProcessSP (pid, procSP))
695 DNBProcessGetState (nub_process_t pid)
698 if (GetProcessSP (pid, procSP))
709 DNBProcessGetExitStatus (nub_process_t pid, int* status)
712 if (GetProcessSP (pid, procSP))
720 DNBProcessSetExitStatus (nub_process_t pid, int status)
723 if (GetProcessSP (pid, procSP))
733 DNBThreadGetName (nub_process_t pid, nub_thread_t tid)
736 if (GetProcessSP (pid, procSP))
743 DNBThreadGetIdentifierInfo (nub_process_t pid, nub_thread_t tid, thread_identifier_info_data_t *ident_info)
746 if (GetProcessSP (pid, procSP))
752 DNBThreadGetState (nub_process_t pid, nub_thread_t tid)
755 if (GetProcessSP (pid, procSP))
783 DNBProcessGetExecutablePath (nub_process_t pid)
786 if (GetProcessSP (pid, procSP))
794 DNBProcessGetArgumentCount (nub_process_t pid)
797 if (GetProcessSP (pid, procSP))
805 DNBProcessGetArgumentAtIndex (nub_process_t pid, nub_size_t idx)
808 if (GetProcessSP (pid, procSP))
820 DNBProcessResume (nub_process_t pid, const DNBThreadResumeAction *actions, size_t num_actions)
822 DNBLogThreadedIf(LOG_PROCESS, "%s(pid = %4.4x)", __FUNCTION__, pid);
824 if (GetProcessSP (pid, procSP))
847 DNBProcessHalt (nub_process_t pid)
849 DNBLogThreadedIf(LOG_PROCESS, "%s(pid = %4.4x)", __FUNCTION__, pid);
851 if (GetProcessSP (pid, procSP))
857 //DNBThreadResume (nub_process_t pid, nub_thread_t tid, nub_bool_t step)
859 // DNBLogThreadedIf(LOG_THREAD, "%s(pid = %4.4x, tid = %4.4x, step = %u)", __FUNCTION__, pid, tid, (uint32_t)step);
861 // if (GetProcessSP (pid, procSP))
869 //DNBThreadResumeWithSignal (nub_process_t pid, nub_thread_t tid, nub_bool_t step, int signal)
871 // DNBLogThreadedIf(LOG_THREAD, "%s(pid = %4.4x, tid = %4.4x, step = %u, signal = %i)", __FUNCTION__, pid, tid, (uint32_t)step, signal);
873 // if (GetProcessSP (pid, procSP))
881 DNBProcessWaitForEvents (nub_process_t pid, nub_event_t event_mask, bool wait_for_set, struct timespec* timeout)
885 if (GetProcessSP (pid, procSP))
896 DNBProcessResetEvents (nub_process_t pid, nub_event_t event_mask)
899 if (GetProcessSP (pid, procSP))
905 DNBBreakpointSet (nub_process_t pid, nub_addr_t addr, nub_size_t size, nub_bool_t hardware)
908 if (GetProcessSP (pid, procSP))
914 DNBBreakpointClear (nub_process_t pid, nub_addr_t addr)
917 if (GetProcessSP (pid, procSP))
927 DNBWatchpointSet (nub_process_t pid, nub_addr_t addr, nub_size_t size, uint32_t watch_flags, nub_bool_t hardware)
930 if (GetProcessSP (pid, procSP))
936 DNBWatchpointClear (nub_process_t pid, nub_addr_t addr)
939 if (GetProcessSP (pid, procSP))
948 DNBWatchpointGetNumSupportedHWP (nub_process_t pid)
951 if (GetProcessSP (pid, procSP))
964 DNBProcessMemoryRead (nub_process_t pid, nub_addr_t addr, nub_size_t size, void *buf)
967 if (GetProcessSP (pid, procSP))
980 DNBProcessMemoryWrite (nub_process_t pid, nub_addr_t addr, nub_size_t size, const void *buf)
983 if (GetProcessSP (pid, procSP))
989 DNBProcessMemoryAllocate (nub_process_t pid, nub_size_t size, uint32_t permissions)
992 if (GetProcessSP (pid, procSP))
998 DNBProcessMemoryDeallocate (nub_process_t pid, nub_addr_t addr)
1001 if (GetProcessSP (pid, procSP))
1021 DNBProcessMemoryRegionInfo (nub_process_t pid, nub_addr_t addr, DNBRegionInfo *region_info)
1024 if (GetProcessSP (pid, procSP))
1031 DNBProcessGetProfileData (nub_process_t pid, DNBProfileDataScanType scanType)
1034 if (GetProcessSP (pid, procSP))
1041 DNBProcessSetEnableAsyncProfiling (nub_process_t pid, nub_bool_t enable, uint64_t interval_usec, DNBProfileDataScanType scan_type)
1044 if (GetProcessSP (pid, procSP))
1058 DNBPrintf (nub_process_t pid, nub_thread_t tid, nub_addr_t base_addr, FILE *file, const char *format)
1161 if (DNBThreadGetRegisterValueByName(pid, tid, REGISTER_SET_ALL, register_name.c_str(), &register_value))
1197 fprintf(file, "error: unable to read register '%s' for process %#.4x and thread %#.8" PRIx64 "\n", register_name.c_str(), pid, tid);
1406 while ((bytes_read = DNBProcessMemoryRead(pid, str_addr, string_buf_len, &string_buf[0])) > 0)
1445 bytes_read = DNBProcessMemoryRead(pid, addr, buf.size(), &buf[0]);
1563 DNBProcessGetNumThreads (nub_process_t pid)
1566 if (GetProcessSP (pid, procSP))
1575 DNBProcessGetCurrentThread (nub_process_t pid)
1578 if (GetProcessSP (pid, procSP))
1587 DNBProcessGetCurrentThreadMachPort (nub_process_t pid)
1590 if (GetProcessSP (pid, procSP))
1599 DNBProcessSetCurrentThread (nub_process_t pid, nub_thread_t tid)
1602 if (GetProcessSP (pid, procSP))
1613 DNBThreadGetStopReason (nub_process_t pid, nub_thread_t tid, struct DNBThreadStopInfo *stop_info)
1616 if (GetProcessSP (pid, procSP))
1629 DNBThreadGetInfo (nub_process_t pid, nub_thread_t tid)
1632 if (GetProcessSP (pid, procSP))
1641 DNBProcessGetThreadAtIndex (nub_process_t pid, size_t thread_idx)
1644 if (GetProcessSP (pid, procSP))
1653 DNBProcessSyncThreadState (nub_process_t pid, nub_thread_t tid)
1656 if (GetProcessSP (pid, procSP))
1663 DNBProcessGetSharedLibraryInfoAddress (nub_process_t pid)
1667 if (GetProcessSP (pid, procSP))
1674 DNBProcessSharedLibrariesUpdated(nub_process_t pid)
1677 if (GetProcessSP (pid, procSP))
1691 DNBProcessGetSharedLibraryInfo (nub_process_t pid, nub_bool_t only_changed, struct DNBExecutableImageInfo **image_infos)
1694 if (GetProcessSP (pid, procSP))
1717 DNBThreadGetRegisterValueByID (nub_process_t pid, nub_thread_t tid, uint32_t set, uint32_t reg, DNBRegisterValue *value)
1721 if (GetProcessSP (pid, procSP))
1730 DNBThreadSetRegisterValueByID (nub_process_t pid, nub_thread_t tid, uint32_t set, uint32_t reg, const DNBRegisterValue *value)
1735 if (GetProcessSP (pid, procSP))
1742 DNBThreadGetRegisterContext (nub_process_t pid, nub_thread_t tid, void *buf, size_t buf_len)
1745 if (GetProcessSP (pid, procSP))
1756 DNBThreadSetRegisterContext (nub_process_t pid, nub_thread_t tid, const void *buf, size_t buf_len)
1759 if (GetProcessSP (pid, procSP))
1771 DNBThreadGetRegisterValueByName (nub_process_t pid, nub_thread_t tid, uint32_t reg_set, const char *reg_name, DNBRegisterValue *value)
1775 if (GetProcessSP (pid, procSP))
1860 DNBProcessSetNameToAddressCallback (nub_process_t pid, DNBCallbackNameToAddress callback, void *baton)
1863 if (GetProcessSP (pid, procSP))
1877 DNBProcessSetSharedLibraryInfoCallback (nub_process_t pid, DNBCallbackCopyExecutableImageInfos callback, void *baton)
1880 if (GetProcessSP (pid, procSP))
1889 DNBProcessLookupAddress (nub_process_t pid, const char *name, const char *shlib)
1892 if (GetProcessSP (pid, procSP))
1901 DNBProcessGetAvailableSTDOUT (nub_process_t pid, char *buf, nub_size_t buf_size)
1904 if (GetProcessSP (pid, procSP))
1910 DNBProcessGetAvailableSTDERR (nub_process_t pid, char *buf, nub_size_t buf_size)
1913 if (GetProcessSP (pid, procSP))
1919 DNBProcessGetAvailableProfileData (nub_process_t pid, char *buf, nub_size_t buf_size)
1922 if (GetProcessSP (pid, procSP))
1928 DNBProcessGetStopCount (nub_process_t pid)
1931 if (GetProcessSP (pid, procSP))
1937 DNBProcessGetCPUType (nub_process_t pid)
1940 if (GetProcessSP (pid, procSP))