VirtualBox

Changeset 16439 in vbox for trunk


Ignore:
Timestamp:
Jan 31, 2009 1:55:36 AM (16 years ago)
Author:
vboxsync
Message:

ldrkStuff: 64-bit darwin changes, better error assertions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/ldr/ldrkStuff.cpp

    r16404 r16439  
    4949#include <k/kLdr.h>
    5050#include <k/kRdrAll.h>
     51#include <k/kErr.h>
    5152#include <k/kErrors.h>
    5253#include <k/kMagics.h>
     
    170171        case KLDR_ERR_SYMBOL_NOT_FOUND:                     return VERR_SYMBOL_NOT_FOUND;
    171172        case KLDR_ERR_FORWARDER_SYMBOL:                     return VERR_BAD_EXE_FORMAT;
    172         case KLDR_ERR_BAD_FIXUP:                            return VERR_BAD_EXE_FORMAT;
     173        case KLDR_ERR_BAD_FIXUP:                            AssertMsgFailedReturn(("KLDR_ERR_BAD_FIXUP\n"), VERR_BAD_EXE_FORMAT);
    173174        case KLDR_ERR_IMPORT_ORDINAL_OUT_OF_BOUNDS:         return VERR_BAD_EXE_FORMAT;
    174175        case KLDR_ERR_NO_DEBUG_INFO:                        return VERR_FILE_NOT_FOUND;
     
    192193        case KLDR_ERR_NOT_DLL:
    193194        case KLDR_ERR_NOT_EXE:
    194             return VERR_GENERAL_FAILURE;
     195            AssertMsgFailedReturn(("krc=%d (%#x): %s\n", krc, krc, kErrName(krc)), VERR_GENERAL_FAILURE);
    195196
    196197
     
    203204        case KLDR_ERR_PE_BAD_FIXUP:
    204205        case KLDR_ERR_PE_BAD_IMPORT:
    205             return VERR_GENERAL_FAILURE;
     206            AssertMsgFailedReturn(("krc=%d (%#x): %s\n", krc, krc, kErrName(krc)), VERR_GENERAL_FAILURE);
    206207
    207208        case KLDR_ERR_LX_BAD_HEADER:
     
    217218        case KLDR_ERR_LX_BAD_FORWARDER:
    218219        case KLDR_ERR_LX_NRICHAIN_NOT_SUPPORTED:
    219             return VERR_GENERAL_FAILURE;
     220            AssertMsgFailedReturn(("krc=%d (%#x): %s\n", krc, krc, kErrName(krc)), VERR_GENERAL_FAILURE);
    220221
    221222        case KLDR_ERR_MACHO_OTHER_ENDIAN_NOT_SUPPORTED:
     
    238239        case KLDR_ERR_MACHO_BAD_SYMBOL:
    239240        case KLDR_ERR_MACHO_UNSUPPORTED_FIXUP_TYPE:
    240             AssertMsgFailed(("krc=%d (%#x); KLDR_ERR_MACHO_BASE=%d; off=%d\n", krc, krc, KLDR_ERR_MACHO_BASE, krc - KLDR_ERR_MACHO_BASE));
    241             return VERR_GENERAL_FAILURE;
     241            AssertMsgFailedReturn(("krc=%d (%#x): %s\n", krc, krc, kErrName(krc)), VERR_GENERAL_FAILURE);
    242242
    243243        default:
    244244            if (RT_FAILURE(krc))
    245245                return krc;
    246             AssertMsgFailed(("krc=%d (%#x)\n", krc, krc));
    247             return VERR_NO_TRANSLATION;
     246            AssertMsgFailedReturn(("krc=%d (%#x): %s\n", krc, krc, kErrName(krc)), VERR_NO_TRANSLATION);
    248247    }
    249248}
     
    501500    }
    502501
    503 #if defined(RT_OS_OS2) || (defined(RT_OS_DARWIN) && defined(RT_ARCH_X86))
     502#if defined(RT_OS_OS2) || defined(RT_OS_DARWIN)
    504503    /* skip the underscore prefix. */
    505504    if (*pszSymbol == '_')
     
    568567    }
    569568
    570 #if defined(RT_OS_OS2) || (defined(RT_OS_DARWIN) && defined(RT_ARCH_X86))
     569#if defined(RT_OS_OS2) || defined(RT_OS_DARWIN)
    571570    /* skip the underscore prefix. */
    572571    if (*pszSymbol == '_')
     
    605604    KLDRADDR uValue;
    606605
    607 #if defined(RT_OS_OS2) || (defined(RT_OS_DARWIN) && defined(RT_ARCH_X86))
     606#if defined(RT_OS_OS2) || defined(RT_OS_DARWIN)
    608607    /*
    609608     * Add underscore prefix.
     
    663662            pNewMod->pMod = pMod;
    664663            *phLdrMod = &pNewMod->Core;
     664
     665#ifdef LOG_ENABLED
     666            Log(("rtldrkLdrOpen: '%s' (%s) %u segments\n",
     667                 pMod->pszName, pMod->pszFilename, pMod->cSegments));
     668            for (unsigned iSeg = 0; iSeg < pMod->cSegments; iSeg++)
     669            {
     670                Log(("Segment #%-2u: RVA=%08llx cb=%08llx '%.*s'\n", iSeg,
     671                     pMod->aSegments[iSeg].RVA,
     672                     pMod->aSegments[iSeg].cb,
     673                     pMod->aSegments[iSeg].cchName,
     674                     pMod->aSegments[iSeg].pchName));
     675            }
     676#endif
    665677            return VINF_SUCCESS;
    666678        }
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