diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-03-26 19:21:20 +0000 |
---|---|---|
committer | <> | 2014-05-08 15:03:54 +0000 |
commit | fb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch) | |
tree | c2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp | |
parent | 58ed4748338f9466599adfc8a9171280ed99e23f (diff) | |
download | VirtualBox-master.tar.gz |
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp')
-rw-r--r-- | src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp | 56 |
1 files changed, 6 insertions, 50 deletions
diff --git a/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp b/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp index 39726eda..66ef5286 100644 --- a/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp +++ b/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp @@ -4,7 +4,7 @@ */ /* - * Copyright (C) 2010-2011 Oracle Corporation + * Copyright (C) 2010-2012 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -162,7 +162,7 @@ static int ReadFileNoIntr(int fd, void *pv, size_t cbToRead) * * @param fd Handle to the file to write to. * @param pv Pointer to what to write. - * @param cbToWrite Size of data to write. + * @param cbToWrite Size of data to write. * * @return IPRT status code. */ @@ -191,9 +191,9 @@ static int WriteFileNoIntr(int fd, const void *pv, size_t cbToWrite) * Read from a given offset in the process' address space. * * @param pSolProc Pointer to the solaris process. - * @param pv Where to read the data into. - * @param cb Size of the read buffer. - * @param off Offset to read from. + * @param off The offset to read from. + * @param pvBuf Where to read the data into. + * @param cbToRead Number of bytes to read. * * @return VINF_SUCCESS, if all the given bytes was read in, otherwise VERR_READ_ERROR. */ @@ -1263,51 +1263,8 @@ static int rtCoreDumperResumeThreads(PRTSOLCORE pSolCore) { AssertReturn(pSolCore, VERR_INVALID_POINTER); -#if 1 uint64_t cThreads; return rtCoreDumperForEachThread(pSolCore, &cThreads, resumeThread); -#else - PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc; - - char szCurThread[128]; - char szPath[PATH_MAX]; - PRTDIR pDir = NULL; - - RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/lwp", (int)pSolProc->Process); - RTStrPrintf(szCurThread, sizeof(szCurThread), "%d", (int)pSolProc->hCurThread); - - int32_t cRunningThreads = 0; - int rc = RTDirOpen(&pDir, szPath); - if (RT_SUCCESS(rc)) - { - /* - * Loop through all our threads & resume them. - */ - RTDIRENTRY DirEntry; - while (RT_SUCCESS(RTDirRead(pDir, &DirEntry, NULL))) - { - if ( !strcmp(DirEntry.szName, ".") - || !strcmp(DirEntry.szName, "..")) - continue; - - if ( !strcmp(DirEntry.szName, szCurThread)) - continue; - - int32_t ThreadId = RTStrToInt32(DirEntry.szName); - _lwp_continue((lwpid_t)ThreadId); - ++cRunningThreads; - } - - CORELOG((CORELOG_NAME "ResumeAllThreads: resumed %d threads\n", cRunningThreads)); - RTDirClose(pDir); - } - else - { - CORELOGRELSYS((CORELOG_NAME "ResumeAllThreads: Failed to open %s\n", szPath)); - rc = VERR_READ_ERROR; - } - return rc; -#endif } @@ -2116,8 +2073,7 @@ static int rtCoreDumperDestroyCore(PRTSOLCORE pSolCore) /** - * Takes a core dump. This function has no other parameters than the context - * because it can be called from signal handlers. + * Takes a core dump. * * @param pContext The context of the caller. * @param pszOutputFile Path of the core file. If NULL is passed, the |