VirtualBox

Changeset 50665 in vbox for trunk/src


Ignore:
Timestamp:
Mar 3, 2014 11:55:01 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92596
Message:

DBGC: add detection of Linux 3.x

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Debugger/DBGPlugInLinux.cpp

    r44528 r50665  
    198198        DBGFR3AddrFromFlat(pUVM, &KernelAddr, g_au64LnxKernelAddresses[i]);
    199199        DBGFADDRESS HitAddr;
    200         static const uint8_t s_abLinuxVersion[] = "Linux version 2.";
     200        static const uint8_t s_abLinuxVersion2x[] = "Linux version 2.";
    201201        int rc = DBGFR3MemScan(pUVM, 0, &KernelAddr, LNX_MAX_KERNEL_SIZE, 1,
    202                                s_abLinuxVersion, sizeof(s_abLinuxVersion) - 1, &HitAddr);
     202                               s_abLinuxVersion2x, sizeof(s_abLinuxVersion2x) - 1, &HitAddr);
    203203        if (RT_SUCCESS(rc))
    204204        {
    205205            char szTmp[128];
    206             char const *pszY = &szTmp[sizeof(s_abLinuxVersion) - 1];
     206            char const *pszY = &szTmp[sizeof(s_abLinuxVersion2x) - 1];
    207207            rc = DBGFR3MemReadString(pUVM, 0, &HitAddr, szTmp, sizeof(szTmp));
    208208            if (    RT_SUCCESS(rc)
    209209                &&  *pszY >= '0'
    210210                &&  *pszY <= '6')
     211            {
     212                pThis->AddrKernelBase  = KernelAddr;
     213                pThis->AddrLinuxBanner = HitAddr;
     214                return true;
     215            }
     216        }
     217        static const uint8_t s_abLinuxVersion3x[] = "Linux version 3.";
     218        rc = DBGFR3MemScan(pUVM, 0, &KernelAddr, LNX_MAX_KERNEL_SIZE, 1,
     219                           s_abLinuxVersion3x, sizeof(s_abLinuxVersion3x) - 1, &HitAddr);
     220        if (RT_SUCCESS(rc))
     221        {
     222            char szTmp[128];
     223            char const *pszY = &szTmp[sizeof(s_abLinuxVersion3x) - 1];
     224            rc = DBGFR3MemReadString(pUVM, 0, &HitAddr, szTmp, sizeof(szTmp));
     225            if (    RT_SUCCESS(rc)
     226                &&  *pszY >= '0'
     227                &&  *pszY <= '9')
    211228            {
    212229                pThis->AddrKernelBase  = KernelAddr;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette