VirtualBox

Changeset 77775 in vbox


Ignore:
Timestamp:
Mar 19, 2019 1:00:20 AM (6 years ago)
Author:
vboxsync
Message:

DBGPlugInLinux.cpp: More verbose on errors.

File:
1 edited

Legend:

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

    r76553 r77775  
    687687            if (RT_SUCCESS(rc))
    688688                continue;
    689             Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: Reading '%s' at %RGv: %Rrc\n", aSymbols[i].pszSymbol, Addr.FlatPtr, rc));
     689            LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: Reading '%s' at %RGv: %Rrc\n", aSymbols[i].pszSymbol, Addr.FlatPtr, rc));
    690690        }
    691691        else
    692             Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: Error looking up '%s': %Rrc\n", aSymbols[i].pszSymbol, rc));
     692            LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: Error looking up '%s': %Rrc\n", aSymbols[i].pszSymbol, rc));
    693693        rc = VERR_NOT_FOUND;
    694694        break;
     
    713713    if (pThis->f64Bit ? !LNX64_VALID_ADDRESS(GCPtrLogBuf) : !LNX32_VALID_ADDRESS(GCPtrLogBuf))
    714714    {
    715         Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: 'log_buf' value %RGv is not valid.\n", GCPtrLogBuf));
     715        LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: 'log_buf' value %RGv is not valid.\n", GCPtrLogBuf));
    716716        return VERR_NOT_FOUND;
    717717    }
     
    720720        || cbLogBuf > 16*_1M)
    721721    {
    722         Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: 'log_buf_len' value %#x is not valid.\n", cbLogBuf));
     722        LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: 'log_buf_len' value %#x is not valid.\n", cbLogBuf));
    723723        return VERR_NOT_FOUND;
    724724    }
     
    730730    if (!pbLogBuf)
    731731    {
    732         Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: Failed to allocate %#x bytes for log buffer\n", cbLogBuf));
     732        LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: Failed to allocate %#x bytes for log buffer\n", cbLogBuf));
    733733        return VERR_NO_MEMORY;
    734734    }
     
    737737    if (RT_FAILURE(rc))
    738738    {
    739         Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: Error reading %#x bytes of log buffer at %RGv: %Rrc\n",
    740              cbLogBuf, Addr.FlatPtr, rc));
     739        LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: Error reading %#x bytes of log buffer at %RGv: %Rrc\n",
     740                cbLogBuf, Addr.FlatPtr, rc));
    741741        RTMemFree(pbLogBuf);
    742742        return VERR_NOT_FOUND;
     
    805805            if (RT_SUCCESS(rc))
    806806                continue;
    807             Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: Reading '%s' at %RGv: %Rrc\n", aSymbols[i].pszSymbol, Addr.FlatPtr, rc));
     807            LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: Reading '%s' at %RGv: %Rrc\n", aSymbols[i].pszSymbol, Addr.FlatPtr, rc));
    808808        }
    809809        else
    810             Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: Error looking up '%s': %Rrc\n", aSymbols[i].pszSymbol, rc));
     810            LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: Error looking up '%s': %Rrc\n", aSymbols[i].pszSymbol, rc));
    811811        rc = VERR_NOT_FOUND;
    812812        break;
     
    833833    if (pThis->f64Bit ? !LNX64_VALID_ADDRESS(GCPtrLogBuf) : !LNX32_VALID_ADDRESS(GCPtrLogBuf))
    834834    {
    835         Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: 'log_buf' value %RGv is not valid.\n", GCPtrLogBuf));
     835        LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: 'log_buf' value %RGv is not valid.\n", GCPtrLogBuf));
    836836        return VERR_NOT_FOUND;
    837837    }
     
    840840        || cbLogBuf > 16*_1M)
    841841    {
    842         Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: 'log_buf_len' value %#x is not valid.\n", cbLogBuf));
     842        LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: 'log_buf_len' value %#x is not valid.\n", cbLogBuf));
    843843        return VERR_NOT_FOUND;
    844844    }
     
    847847        || (idxFirst & (cbLogAlign - 1)) != 0)
    848848    {
    849         Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: 'log_first_idx' value %#x is not valid.\n", idxFirst));
     849        LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: 'log_first_idx' value %#x is not valid.\n", idxFirst));
    850850        return VERR_NOT_FOUND;
    851851    }
     
    853853        || (idxNext & (cbLogAlign - 1)) != 0)
    854854    {
    855         Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: 'log_next_idx' value %#x is not valid.\n", idxNext));
     855        LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: 'log_next_idx' value %#x is not valid.\n", idxNext));
    856856        return VERR_NOT_FOUND;
    857857    }
     
    863863    if (!pbLogBuf)
    864864    {
    865         Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: Failed to allocate %#x bytes for log buffer\n", cbLogBuf));
     865        LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: Failed to allocate %#x bytes for log buffer\n", cbLogBuf));
    866866        return VERR_NO_MEMORY;
    867867    }
     
    870870    if (RT_FAILURE(rc))
    871871    {
    872         Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: Error reading %#x bytes of log buffer at %RGv: %Rrc\n",
    873              cbLogBuf, Addr.FlatPtr, rc));
     872        LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: Error reading %#x bytes of log buffer at %RGv: %Rrc\n",
     873                cbLogBuf, Addr.FlatPtr, rc));
    874874        RTMemFree(pbLogBuf);
    875875        return VERR_NOT_FOUND;
     
    901901                        || pHdr->cbTotal < (uint32_t)pHdr->cbText + (uint32_t)pHdr->cbDict + sizeof(*pHdr) ))
    902902        {
    903             Log(("dbgDiggerLinuxIDmsg_QueryKernelLog: Invalid printk_log record at %#x: cbTotal=%#x cbText=%#x cbDict=%#x cbLogBuf=%#x cbLeft=%#x\n",
    904                  offCur, pHdr->cbTotal, pHdr->cbText, pHdr->cbDict, cbLogBuf, cbLeft));
     903            LogRel(("dbgDiggerLinuxIDmsg_QueryKernelLog: Invalid printk_log record at %#x: cbTotal=%#x cbText=%#x cbDict=%#x cbLogBuf=%#x cbLeft=%#x\n",
     904                    offCur, pHdr->cbTotal, pHdr->cbText, pHdr->cbDict, cbLogBuf, cbLeft));
    905905            rc = VERR_INVALID_STATE;
    906906            break;
     
    10131013    RTDBGMOD hMod;
    10141014    int rc = RTDbgAsModuleByName(hAs, "vmlinux", 0, &hMod);
     1015    RTDbgAsRelease(hAs);
    10151016    if (RT_FAILURE(rc))
    10161017        return VERR_NOT_FOUND;
    1017     RTDbgAsRelease(hAs);
    1018 
    1019     size_t cbActual;
     1018
    10201019    /*
    10211020     * Check whether the kernel log buffer is a simple char buffer or the newer
     
    10241023     * see: http://thread.gmane.org/gmane.linux.kernel/1284184
    10251024     */
     1025    size_t cbActual;
    10261026    if (dbgDiggerLinuxLogBufferIsAsciiBuffer(pData, pUVM))
    10271027        rc = dbgDiggerLinuxLogBufferQueryAscii(pData, pUVM, hMod, fFlags, cMessages, pszBuf, cbBuf, &cbActual);
Note: See TracChangeset for help on using the changeset viewer.

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