Index: trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp	(revision 46162)
+++ trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp	(revision 46164)
@@ -413,5 +413,5 @@
                             pDbgMod->pDbgVt = pCur->pVt;
                             pDbgMod->pvDbgPriv = NULL;
-                            rc = pCur->pVt->pfnTryOpen(pDbgMod);
+                            rc = pCur->pVt->pfnTryOpen(pDbgMod, RTLDRARCH_WHATEVER);
                             if (RT_SUCCESS(rc))
                             {
@@ -476,5 +476,5 @@
             pDbgMod->pDbgVt    = pDbg->pVt;
             pDbgMod->pvDbgPriv = NULL;
-            rc = pDbg->pVt->pfnTryOpen(pDbgMod);
+            rc = pDbg->pVt->pfnTryOpen(pDbgMod, pDbgMod->pImgVt->pfnGetArch(pDbgMod));
             if (RT_SUCCESS(rc))
             {
@@ -506,4 +506,5 @@
     Assert(!pDbgMod->pvDbgPriv);
     Assert(!pDbgMod->pszDbgFile);
+    Assert(pDbgMod->pImgVt);
 
     /*
@@ -519,5 +520,5 @@
             pDbgMod->pDbgVt    = pDbg->pVt;
             pDbgMod->pvDbgPriv = NULL;
-            rc = pDbg->pVt->pfnTryOpen(pDbgMod);
+            rc = pDbg->pVt->pfnTryOpen(pDbgMod, pDbgMod->pImgVt->pfnGetArch(pDbgMod));
             if (RT_SUCCESS(rc))
             {
@@ -674,4 +675,5 @@
     Assert(!pDbgMod->pvDbgPriv);
     Assert(!pDbgMod->pszDbgFile);
+    Assert(pDbgMod->pImgVt);
 
     /*
@@ -687,5 +689,5 @@
             pDbgMod->pDbgVt    = pDbg->pVt;
             pDbgMod->pvDbgPriv = NULL;
-            rc = pDbg->pVt->pfnTryOpen(pDbgMod);
+            rc = pDbg->pVt->pfnTryOpen(pDbgMod, pDbgMod->pImgVt->pfnGetArch(pDbgMod));
             if (RT_SUCCESS(rc))
             {
@@ -867,5 +869,5 @@
                             pDbgMod->pDbgVt = pDbg->pVt;
                             pDbgMod->pvDbgPriv = NULL;
-                            rc = pDbg->pVt->pfnTryOpen(pDbgMod);
+                            rc = pDbg->pVt->pfnTryOpen(pDbgMod, enmArch);
                             if (RT_SUCCESS(rc))
                             {
Index: trunk/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp	(revision 46162)
+++ trunk/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp	(revision 46164)
@@ -676,7 +676,7 @@
 
 /** @copydoc RTDBGMODVTDBG::pfnTryOpen */
-static DECLCALLBACK(int) rtDbgModContainer_TryOpen(PRTDBGMODINT pMod)
-{
-    NOREF(pMod);
+static DECLCALLBACK(int) rtDbgModContainer_TryOpen(PRTDBGMODINT pMod, RTLDRARCH enmArch)
+{
+    NOREF(pMod); NOREF(enmArch);
     return VERR_INTERNAL_ERROR_5;
 }
Index: trunk/src/VBox/Runtime/common/dbg/dbgmoddbghelp.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/dbg/dbgmoddbghelp.cpp	(revision 46162)
+++ trunk/src/VBox/Runtime/common/dbg/dbgmoddbghelp.cpp	(revision 46164)
@@ -386,6 +386,8 @@
 
 /** @interface_method_impl{RTDBGMODVTDBG,pfnTryOpen} */
-static DECLCALLBACK(int) rtDbgModDbgHelp_TryOpen(PRTDBGMODINT pMod)
-{
+static DECLCALLBACK(int) rtDbgModDbgHelp_TryOpen(PRTDBGMODINT pMod, RTLDRARCH enmArch)
+{
+    NOREF(enmArch);
+
     /*
      * Currently only support external files with a executable already present.
Index: trunk/src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp	(revision 46162)
+++ trunk/src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp	(revision 46164)
@@ -391,6 +391,7 @@
 
 /** @interface_method_impl{RTDBGMODVTDBG,pfnTryOpen} */
-static DECLCALLBACK(int) rtDbgModDeferredDbg_TryOpen(PRTDBGMODINT pMod)
-{
+static DECLCALLBACK(int) rtDbgModDeferredDbg_TryOpen(PRTDBGMODINT pMod, RTLDRARCH enmArch)
+{
+    NOREF(enmArch);
     return rtDbgModDeferredDoIt(pMod, true /*fForceRetry*/);
 }
@@ -438,4 +439,17 @@
  *
  */
+
+
+/** @interface_method_impl{RTDBGMODVTIMG,pfnGetArch} */
+static DECLCALLBACK(RTLDRARCH) rtDbgModDeferredImg_GetArch(PRTDBGMODINT pMod)
+{
+    RTLDRARCH enmArch;
+    int rc = rtDbgModDeferredDoIt(pMod, false /*fForceRetry*/);
+    if (RT_SUCCESS(rc))
+        enmArch = pMod->pImgVt->pfnGetArch(pMod);
+    else
+        enmArch = RTLDRARCH_WHATEVER;
+    return enmArch;
+}
 
 
@@ -567,4 +581,5 @@
     /*.pfnUnmapPart = */                rtDbgModDeferredImg_UnmapPart,
     /*.pfnGetFormat = */                rtDbgModDeferredImg_GetFormat,
+    /*.pfnGetArch = */                  rtDbgModDeferredImg_GetArch,
 
     /*.u32EndMagic = */                 RTDBGMODVTIMG_MAGIC
Index: trunk/src/VBox/Runtime/common/dbg/dbgmoddwarf.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/dbg/dbgmoddwarf.cpp	(revision 46162)
+++ trunk/src/VBox/Runtime/common/dbg/dbgmoddwarf.cpp	(revision 46164)
@@ -41,4 +41,5 @@
 #include <iprt/path.h>
 #include <iprt/string.h>
+#include <iprt/strcache.h>
 #include "internal/dbgmod.h"
 
@@ -420,6 +421,10 @@
     /** The debug container containing doing the real work. */
     RTDBGMOD                hCnt;
-    /** Pointer to back to the debug info module (no reference ofc). */
-    PRTDBGMODINT            pMod;
+    /** The image module (no reference). */
+    PRTDBGMODINT            pImgMod;
+    /** The debug info module (no reference). */
+    PRTDBGMODINT            pDbgInfoMod;
+    /** Nested image module (with reference ofc). */
+    PRTDBGMODINT            pNestedMod;
 
     /** DWARF debug info sections. */
@@ -1192,11 +1197,10 @@
  * @returns IPRT status code.
  * @param   pThis               The DWARF instance.
- * @param   pMod                The debug module.
- */
-static int rtDbgModDwarfAddSegmentsFromImage(PRTDBGMODDWARF pThis, PRTDBGMODINT pMod)
-{
-    AssertReturn(pMod->pImgVt, VERR_INTERNAL_ERROR_2);
+ */
+static int rtDbgModDwarfAddSegmentsFromImage(PRTDBGMODDWARF pThis)
+{
+    AssertReturn(pThis->pImgMod && pThis->pImgMod->pImgVt, VERR_INTERNAL_ERROR_2);
     Assert(!pThis->cSegs);
-    int rc = pMod->pImgVt->pfnEnumSegments(pMod, rtDbgModDwarfScanSegmentsCallback, pThis);
+    int rc = pThis->pImgMod->pImgVt->pfnEnumSegments(pThis->pImgMod, rtDbgModDwarfScanSegmentsCallback, pThis);
     if (RT_SUCCESS(rc))
     {
@@ -1207,5 +1211,5 @@
             pThis->cSegs = 0;
             pThis->iWatcomPass = -1;
-            rc = pMod->pImgVt->pfnEnumSegments(pMod, rtDbgModDwarfAddSegmentsCallback, pThis);
+            rc = pThis->pImgMod->pImgVt->pfnEnumSegments(pThis->pImgMod, rtDbgModDwarfAddSegmentsCallback, pThis);
         }
     }
@@ -1382,9 +1386,9 @@
      * Do the job.
      */
-    return pThis->pMod->pImgVt->pfnMapPart(pThis->pMod,
-                                           pThis->aSections[enmSect].iDbgInfo,
-                                           pThis->aSections[enmSect].offFile,
-                                           pThis->aSections[enmSect].cb,
-                                           &pThis->aSections[enmSect].pv);
+    return pThis->pDbgInfoMod->pImgVt->pfnMapPart(pThis->pDbgInfoMod,
+                                                  pThis->aSections[enmSect].iDbgInfo,
+                                                  pThis->aSections[enmSect].offFile,
+                                                  pThis->aSections[enmSect].cb,
+                                                  &pThis->aSections[enmSect].pv);
 }
 
@@ -1403,5 +1407,5 @@
         return VINF_SUCCESS;
 
-    int rc = pThis->pMod->pImgVt->pfnUnmapPart(pThis->pMod, pThis->aSections[enmSect].cb, &pThis->aSections[enmSect].pv);
+    int rc = pThis->pDbgInfoMod->pImgVt->pfnUnmapPart(pThis->pDbgInfoMod, pThis->aSections[enmSect].cb, &pThis->aSections[enmSect].pv);
     AssertRC(rc);
     return rc;
@@ -1451,6 +1455,6 @@
     }
 
-    return pThis->pMod->pImgVt->pfnRvaToSegOffset(pThis->pMod, LinkAddress, piSeg, poffSeg);
-    //return pThis->pMod->pImgVt->pfnLinkAddressToSegOffset(pThis->pMod, LinkAddress, piSeg, poffSeg);
+    return pThis->pImgMod->pImgVt->pfnRvaToSegOffset(pThis->pImgMod, LinkAddress, piSeg, poffSeg);
+    //return pThis->pImgMod->pImgVt->pfnLinkAddressToSegOffset(pThis->pImgMod, LinkAddress, piSeg, poffSeg);
 }
 
@@ -4301,5 +4305,5 @@
     PRTDBGMODDWARF pThis = (PRTDBGMODDWARF)pMod->pvDbgPriv;
     RTUINTPTR cb1 = RTDbgModImageSize(pThis->hCnt);
-    RTUINTPTR cb2 = pMod->pImgVt->pfnImageSize(pMod);
+    RTUINTPTR cb2 = pThis->pImgMod->pImgVt->pfnImageSize(pMod);
     return RT_MAX(cb1, cb2);
 }
@@ -4321,8 +4325,16 @@
     for (unsigned iSect = 0; iSect < RT_ELEMENTS(pThis->aSections); iSect++)
         if (pThis->aSections[iSect].pv)
-            pThis->pMod->pImgVt->pfnUnmapPart(pThis->pMod, pThis->aSections[iSect].cb, &pThis->aSections[iSect].pv);
+            pThis->pDbgInfoMod->pImgVt->pfnUnmapPart(pThis->pDbgInfoMod, pThis->aSections[iSect].cb, &pThis->aSections[iSect].pv);
 
     RTDbgModRelease(pThis->hCnt);
     RTMemFree(pThis->paCachedAbbrevs);
+    if (pThis->pNestedMod)
+    {
+        pThis->pNestedMod->pImgVt->pfnClose(pThis->pNestedMod);
+        RTStrCacheRelease(g_hDbgModStrCache, pThis->pNestedMod->pszName);
+        RTStrCacheRelease(g_hDbgModStrCache, pThis->pNestedMod->pszDbgFile);
+        RTMemFree(pThis->pNestedMod);
+        pThis->pNestedMod = NULL;
+    }
     RTMemFree(pThis);
 
@@ -4401,6 +4413,50 @@
 
 
+static int rtDbgModDwarfTryOpenDbgFile(PRTDBGMODINT pDbgMod, PRTDBGMODDWARF pThis, RTLDRARCH enmArch)
+{
+    if (   !pDbgMod->pszDbgFile
+        || RTPathIsSame(pDbgMod->pszDbgFile, pDbgMod->pszImgFile) == true /* returns VERR too */)
+        return VERR_DBG_NO_MATCHING_INTERPRETER;
+
+    /*
+     * Only open the image.
+     */
+    PRTDBGMODINT pDbgInfoMod = (PRTDBGMODINT)RTMemAllocZ(sizeof(*pDbgInfoMod));
+    if (!pDbgInfoMod)
+        return VERR_NO_MEMORY;
+
+    int rc;
+    pDbgInfoMod->u32Magic     = RTDBGMOD_MAGIC;
+    pDbgInfoMod->cRefs        = 1;
+    if (RTStrCacheRetain(pDbgMod->pszDbgFile) != UINT32_MAX)
+    {
+        pDbgInfoMod->pszImgFile = pDbgMod->pszDbgFile;
+        if (RTStrCacheRetain(pDbgMod->pszName) != UINT32_MAX)
+        {
+            pDbgInfoMod->pszName = pDbgMod->pszName;
+            pDbgInfoMod->pImgVt  = &g_rtDbgModVtImgLdr;
+            rc = pDbgInfoMod->pImgVt->pfnTryOpen(pDbgInfoMod, enmArch);
+            if (RT_SUCCESS(rc))
+            {
+                pThis->pDbgInfoMod = pDbgInfoMod;
+                pThis->pNestedMod  = pDbgInfoMod;
+                return VINF_SUCCESS;
+            }
+
+            RTStrCacheRelease(g_hDbgModStrCache, pDbgInfoMod->pszName);
+        }
+        else
+            rc = VERR_NO_STR_MEMORY;
+        RTStrCacheRelease(g_hDbgModStrCache,  pDbgInfoMod->pszImgFile);
+    }
+    else
+        rc = VERR_NO_STR_MEMORY;
+    RTMemFree(pDbgInfoMod);
+    return rc;
+}
+
+
 /** @interface_method_impl{RTDBGMODVTDBG,pfnTryOpen} */
-static DECLCALLBACK(int) rtDbgModDwarf_TryOpen(PRTDBGMODINT pMod)
+static DECLCALLBACK(int) rtDbgModDwarf_TryOpen(PRTDBGMODINT pMod, RTLDRARCH enmArch)
 {
     /*
@@ -4411,13 +4467,26 @@
 
     /*
-     * Enumerate the debug info in the module, looking for DWARF bits.
+     * Create the module instance data.
      */
     PRTDBGMODDWARF pThis = (PRTDBGMODDWARF)RTMemAllocZ(sizeof(*pThis));
     if (!pThis)
         return VERR_NO_MEMORY;
-    pThis->pMod = pMod;
+    pThis->pDbgInfoMod = pMod;
+    pThis->pImgMod     = pMod;
     RTListInit(&pThis->CompileUnitList);
 
-    int rc = pMod->pImgVt->pfnEnumDbgInfo(pMod, rtDbgModDwarfEnumCallback, pThis);
+
+    /*
+     * If the debug file name is set, let's see if it's an ELF image with DWARF
+     * inside it. In that case we'll have to deal with two image modules, one
+     * for segments and address translation and one for the debug information.
+     */
+    if (pMod->pszDbgFile != NULL)
+        rtDbgModDwarfTryOpenDbgFile(pMod, pThis, enmArch);
+
+    /*
+     * Enumerate the debug info in the module, looking for DWARF bits.
+     */
+    int rc = pThis->pDbgInfoMod->pImgVt->pfnEnumDbgInfo(pThis->pDbgInfoMod, rtDbgModDwarfEnumCallback, pThis);
     if (RT_SUCCESS(rc))
     {
@@ -4433,5 +4502,5 @@
                 pMod->pvDbgPriv = pThis;
 
-                rc = rtDbgModDwarfAddSegmentsFromImage(pThis, pMod);
+                rc = rtDbgModDwarfAddSegmentsFromImage(pThis);
                 if (RT_SUCCESS(rc))
                     rc = rtDwarfInfo_LoadAll(pThis);
@@ -4457,6 +4526,6 @@
                     for (unsigned iSect = 0; iSect < RT_ELEMENTS(pThis->aSections); iSect++)
                         if (pThis->aSections[iSect].pv)
-                            pThis->pMod->pImgVt->pfnUnmapPart(pThis->pMod, pThis->aSections[iSect].cb,
-                                                              &pThis->aSections[iSect].pv);
+                            pThis->pDbgInfoMod->pImgVt->pfnUnmapPart(pThis->pDbgInfoMod, pThis->aSections[iSect].cb,
+                                                                     &pThis->aSections[iSect].pv);
 
 
Index: trunk/src/VBox/Runtime/common/dbg/dbgmodldr.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/dbg/dbgmodldr.cpp	(revision 46162)
+++ trunk/src/VBox/Runtime/common/dbg/dbgmodldr.cpp	(revision 46164)
@@ -59,4 +59,12 @@
 typedef RTDBGMODLDR *PRTDBGMODLDR;
 
+
+
+/** @interface_method_impl{RTDBGMODVTIMG,pfnGetArch} */
+static DECLCALLBACK(RTLDRARCH) rtDbgModLdr_GetArch(PRTDBGMODINT pMod)
+{
+    PRTDBGMODLDR pThis = (PRTDBGMODLDR)pMod->pvImgPriv;
+    return RTLdrGetArch(pThis->hLdrMod);
+}
 
 
@@ -198,4 +206,5 @@
     /*.pfnUnmapPart = */                rtDbgModLdr_UnmapPart,
     /*.pfnGetFormat = */                rtDbgModLdr_GetFormat,
+    /*.pfnGetArch = */                  rtDbgModLdr_GetArch,
 
     /*.u32EndMagic = */                 RTDBGMODVTIMG_MAGIC
Index: trunk/src/VBox/Runtime/common/dbg/dbgmodnm.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/dbg/dbgmodnm.cpp	(revision 46162)
+++ trunk/src/VBox/Runtime/common/dbg/dbgmodnm.cpp	(revision 46164)
@@ -478,6 +478,8 @@
 
 /** @interface_method_impl{RTDBGMODVTDBG,pfnTryOpen} */
-static DECLCALLBACK(int) rtDbgModNm_TryOpen(PRTDBGMODINT pMod)
-{
+static DECLCALLBACK(int) rtDbgModNm_TryOpen(PRTDBGMODINT pMod, RTLDRARCH enmArch)
+{
+    NOREF(enmArch);
+
     /*
      * Fend off images.
Index: trunk/src/VBox/Runtime/common/ldr/ldr.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/ldr/ldr.cpp	(revision 46162)
+++ trunk/src/VBox/Runtime/common/ldr/ldr.cpp	(revision 46164)
@@ -121,4 +121,13 @@
 
 
+RTDECL(RTLDRARCH) RTLdrGetArch(RTLDRMOD hLdrMod)
+{
+    AssertMsgReturn(rtldrIsValid(hLdrMod), ("hLdrMod=%p\n", hLdrMod), RTLDRARCH_INVALID);
+    PRTLDRMODINTERNAL pMod = (PRTLDRMODINTERNAL)hLdrMod;
+    return pMod->enmArch;
+}
+RT_EXPORT_SYMBOL(RTLdrGetArch);
+
+
 RTDECL(int) RTLdrClose(RTLDRMOD hLdrMod)
 {
Index: trunk/src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h
===================================================================
--- trunk/src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h	(revision 46162)
+++ trunk/src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h	(revision 46164)
@@ -1440,4 +1440,9 @@
     pModElf->Core.enmType   = RTLDRTYPE_OBJECT;
     pModElf->Core.enmEndian = RTLDRENDIAN_LITTLE;
+#if ELF_MODE == 32
+    pModElf->Core.enmArch   = RTLDRARCH_X86_32;
+#else
+    pModElf->Core.enmArch   = RTLDRARCH_AMD64;
+#endif
     //pModElf->pvBits         = NULL;
     //pModElf->Ehdr           = {0};
Index: trunk/src/VBox/Runtime/common/ldr/ldrNative.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/ldr/ldrNative.cpp	(revision 46162)
+++ trunk/src/VBox/Runtime/common/ldr/ldrNative.cpp	(revision 46164)
@@ -140,4 +140,11 @@
         pMod->Core.enmEndian    = RTLDRENDIAN_LITTLE;
 #endif
+#ifdef RT_ARCH_AMD64
+        pMod->Core.enmArch      = RTLDRARCH_AMD64;
+#elif defined(RT_ARCH_X86)
+        pMod->Core.enmArch      = RTLDRARCH_X86_32;
+#else
+        pMod->Core.enmArch      = RTLDRARCH_HOST;
+#endif
         pMod->hNative           = ~(uintptr_t)0;
 
Index: trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp	(revision 46162)
+++ trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp	(revision 46164)
@@ -2293,4 +2293,9 @@
                                         : RTLDRTYPE_SHARED_LIBRARY_RELOCATABLE;
                 pModPe->Core.enmEndian= RTLDRENDIAN_LITTLE;
+                pModPe->Core.enmArch  = FileHdr.Machine == IMAGE_FILE_MACHINE_I386
+                                      ? RTLDRARCH_X86_32
+                                      : FileHdr.Machine == IMAGE_FILE_MACHINE_AMD64
+                                      ? RTLDRARCH_AMD64
+                                      : RTLDRARCH_WHATEVER;
                 pModPe->pvBits        = NULL;
                 pModPe->offNtHdrs     = offNtHdrs;
Index: trunk/src/VBox/Runtime/common/ldr/ldrkStuff.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/ldr/ldrkStuff.cpp	(revision 46162)
+++ trunk/src/VBox/Runtime/common/ldr/ldrkStuff.cpp	(revision 46164)
@@ -618,6 +618,11 @@
         case KLDRDBGINFOTYPE_DWARF:
             DbgInfo.enmType = RTLDRDBGINFOTYPE_DWARF;
-            if (pszExtFile)
+            if (!pszExtFile)
+                DbgInfo.u.Dwarf.pszSection = pszPartNm;
+            else
+            {
                 DbgInfo.enmType = RTLDRDBGINFOTYPE_DWARF_DWO;
+                DbgInfo.u.Dwo.uCrc32 = 0;
+            }
             break;
         case KLDRDBGINFOTYPE_CODEVIEW:
@@ -922,4 +927,13 @@
                     break;
             }
+            switch (pMod->enmArch)
+            {
+                case KCPUARCH_X86_32:       pNewMod->Core.enmArch   = RTLDRARCH_X86_32; break;
+                case KCPUARCH_AMD64:        pNewMod->Core.enmArch   = RTLDRARCH_AMD64; break;
+                default:
+                    AssertMsgFailed(("%d\n", pMod->enmArch));
+                    pNewMod->Core.enmArch = RTLDRARCH_WHATEVER;
+                    break;
+            }
             pNewMod->pMod          = pMod;
             *phLdrMod = &pNewMod->Core;
Index: trunk/src/VBox/Runtime/include/internal/dbgmod.h
===================================================================
--- trunk/src/VBox/Runtime/include/internal/dbgmod.h	(revision 46162)
+++ trunk/src/VBox/Runtime/include/internal/dbgmod.h	(revision 46164)
@@ -198,10 +198,19 @@
 
     /**
-     * Gets the loader format.
-     *
-     * @returns Valid loader format on success, RTLDRFMT_INVALID if not supported.
+     * Gets the image format.
+     *
+     * @returns Valid image format on success, RTLDRFMT_INVALID if not supported.
      * @param   pMod            Pointer to the module structure.
      */
     DECLCALLBACKMEMBER(RTLDRFMT, pfnGetFormat)(PRTDBGMODINT pMod);
+
+    /**
+     * Gets the image architecture.
+     *
+     * @returns Valid image architecutre on success, RTLDRARCH_WHATEVER if not
+     *          supported.
+     * @param   pMod            Pointer to the module structure.
+     */
+    DECLCALLBACKMEMBER(RTLDRARCH, pfnGetArch)(PRTDBGMODINT pMod);
 
     /** For catching initialization errors (RTDBGMODVTIMG_MAGIC). */
@@ -244,6 +253,7 @@
      *                      Upon successful return the method is expected to
      *                      initialize pDbgOps and pvDbgPriv.
-     */
-    DECLCALLBACKMEMBER(int, pfnTryOpen)(PRTDBGMODINT pMod);
+     * @param   enmArch     The desired architecture.
+     */
+    DECLCALLBACKMEMBER(int, pfnTryOpen)(PRTDBGMODINT pMod, RTLDRARCH enmArch);
 
     /**
Index: trunk/src/VBox/Runtime/include/internal/ldr.h
===================================================================
--- trunk/src/VBox/Runtime/include/internal/ldr.h	(revision 46162)
+++ trunk/src/VBox/Runtime/include/internal/ldr.h	(revision 46164)
@@ -429,4 +429,6 @@
     /** Image endianness.  */
     RTLDRENDIAN             enmEndian;
+    /** Image target architecture.  */
+    RTLDRARCH               enmArch;
 } RTLDRMODINTERNAL;
 
