diff options
author | Felix Geyer <fgeyer@debian.org> | 2014-04-05 22:17:15 +0200 |
---|---|---|
committer | Felix Geyer <fgeyer@debian.org> | 2014-04-05 22:17:15 +0200 |
commit | 1700c7d32f7d9d101cbba9f1fcb8bb57ed16a727 (patch) | |
tree | 727251ad65172262944f82bb0f28601c3fb6f6b3 /src/VBox/Debugger/DBGPlugInLinux.cpp | |
parent | 1e85aed889b772c2f2daa7a6d9e8bd967aa213d8 (diff) | |
download | virtualbox-upstream.tar.gz |
Imported Upstream version 4.3.10-dfsgupstream/4.3.10-dfsgupstream
Diffstat (limited to 'src/VBox/Debugger/DBGPlugInLinux.cpp')
-rw-r--r-- | src/VBox/Debugger/DBGPlugInLinux.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/VBox/Debugger/DBGPlugInLinux.cpp b/src/VBox/Debugger/DBGPlugInLinux.cpp index 05c27f859..bbe5df34c 100644 --- a/src/VBox/Debugger/DBGPlugInLinux.cpp +++ b/src/VBox/Debugger/DBGPlugInLinux.cpp @@ -197,13 +197,13 @@ static DECLCALLBACK(bool) dbgDiggerLinuxProbe(PUVM pUVM, void *pvData) DBGFADDRESS KernelAddr; DBGFR3AddrFromFlat(pUVM, &KernelAddr, g_au64LnxKernelAddresses[i]); DBGFADDRESS HitAddr; - static const uint8_t s_abLinuxVersion[] = "Linux version 2."; + static const uint8_t s_abLinuxVersion2x[] = "Linux version 2."; int rc = DBGFR3MemScan(pUVM, 0, &KernelAddr, LNX_MAX_KERNEL_SIZE, 1, - s_abLinuxVersion, sizeof(s_abLinuxVersion) - 1, &HitAddr); + s_abLinuxVersion2x, sizeof(s_abLinuxVersion2x) - 1, &HitAddr); if (RT_SUCCESS(rc)) { char szTmp[128]; - char const *pszY = &szTmp[sizeof(s_abLinuxVersion) - 1]; + char const *pszY = &szTmp[sizeof(s_abLinuxVersion2x) - 1]; rc = DBGFR3MemReadString(pUVM, 0, &HitAddr, szTmp, sizeof(szTmp)); if ( RT_SUCCESS(rc) && *pszY >= '0' @@ -214,6 +214,23 @@ static DECLCALLBACK(bool) dbgDiggerLinuxProbe(PUVM pUVM, void *pvData) return true; } } + static const uint8_t s_abLinuxVersion3x[] = "Linux version 3."; + rc = DBGFR3MemScan(pUVM, 0, &KernelAddr, LNX_MAX_KERNEL_SIZE, 1, + s_abLinuxVersion3x, sizeof(s_abLinuxVersion3x) - 1, &HitAddr); + if (RT_SUCCESS(rc)) + { + char szTmp[128]; + char const *pszY = &szTmp[sizeof(s_abLinuxVersion3x) - 1]; + rc = DBGFR3MemReadString(pUVM, 0, &HitAddr, szTmp, sizeof(szTmp)); + if ( RT_SUCCESS(rc) + && *pszY >= '0' + && *pszY <= '9') + { + pThis->AddrKernelBase = KernelAddr; + pThis->AddrLinuxBanner = HitAddr; + return true; + } + } } return false; } |