Changeset 105988 in vbox for trunk/src/VBox
- Timestamp:
- Sep 9, 2024 4:08:22 PM (7 months ago)
- svn:sync-xref-src-repo-rev:
- 164732
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGPlugInOS2.cpp
r104607 r105988 90 90 91 91 /** 92 * 32-bit OS/2 loader module table entry .92 * 32-bit OS/2 loader module table entry (V3.0 and later). 93 93 */ 94 94 typedef struct LDRMTE … … 106 106 uint32_t mte_modver; /**< added even later. */ 107 107 } LDRMTE; 108 AssertCompileSize(LDRMTE, 40); 109 110 /** 111 * 32-bit OS/2 loader module table entry (V2.11). 112 */ 113 typedef struct LDRMTE2 114 { 115 uint16_t mte_flags2; 116 uint16_t mte_handle; 117 uint32_t mte_swapmte; /**< Pointer to LDRSMTE. */ 118 uint32_t mte_modname; /**< Pointer to module name. */ 119 uint32_t mte_link; /**< Pointer to next LDRMTE2. */ 120 uint32_t mte_flags1; 121 uint32_t mte_impmodcnt; 122 uint16_t mte_sfn; 123 uint16_t mte_usecnt; 124 } LDRMTE2; 125 AssertCompileSize(LDRMTE2, 28); 126 108 127 /** @name LDRMTE::mte_flag2 values 109 128 * @{ */ … … 874 893 875 894 895 static void dbgdiggerOS2FixupMTE(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGEROS2 pThis, DBGDIGGEROS2BUF *pBuf) 896 { 897 /** @todo OS/2 2.0 used a different format of SAS and likely MTE as well; not supported */ 898 if (pThis->OS2MajorVersion == 20 && pThis->OS2MinorVersion < 30) 899 { 900 /* 901 * The MTE was laid out differently in OS/2 2.11, but contained the 902 * same information as in 3.0. After reading the MTE from guest memory, 903 * we can just shuffle things around. 904 * NB: The OS/2 Debugging Handbook doesn't exactly explain that in the 905 * old MTE format, mte_modname is actually a pointer to the ASCII string, 906 * preceded by a length byte. 907 * Must be called before dbgdiggerOS2ProcessModule(). 908 */ 909 LDRMTE2 OldMte; 910 char achNameBuf[9]; 911 912 memcpy(&OldMte, &pBuf->mte, sizeof(OldMte)); 913 914 pBuf->mte.mte_flags2 = OldMte.mte_flags2; 915 pBuf->mte.mte_handle = OldMte.mte_handle; 916 pBuf->mte.mte_swapmte = OldMte.mte_swapmte; 917 pBuf->mte.mte_link = OldMte.mte_link; 918 pBuf->mte.mte_flags1 = OldMte.mte_flags1; 919 pBuf->mte.mte_impmodcnt = OldMte.mte_impmodcnt; 920 pBuf->mte.mte_sfn = OldMte.mte_sfn; 921 pBuf->mte.mte_usecnt = OldMte.mte_usecnt; 922 923 /* 924 * Deal with the module name. We assume that in OS/2 V2.x the module name was in 925 * practice restricted to 8 chars, just like it is in V3.0 (pretty safe assumption). 926 */ 927 DBGFADDRESS Addr; 928 int rc = pVMM->pfnDBGFR3MemRead(pUVM, 0 /*idCpu*/, pVMM->pfnDBGFR3AddrFromFlat(pUVM, &Addr, OldMte.mte_modname), 929 &achNameBuf, sizeof(achNameBuf)); 930 if (RT_SUCCESS(rc)) 931 { 932 memset(pBuf->mte.mte_modname, 0, 8); 933 if((uint8_t)achNameBuf[0] <= 8) 934 memcpy(pBuf->mte.mte_modname, &achNameBuf[1], achNameBuf[0]); 935 else 936 memcpy(pBuf->mte.mte_modname, "!NameErr", 8); 937 } 938 else 939 { 940 memcpy(pBuf->mte.mte_modname, "!RdErr", 6); 941 } 942 } 943 } 944 945 876 946 static void dbgdiggerOS2ProcessModule(PUVM pUVM, PCVMMR3VTABLE pVMM, PDBGDIGGEROS2 pThis, DBGDIGGEROS2BUF *pBuf, 877 947 const char *pszCacheSubDir, RTDBGAS hAs, RTDBGCFG hDbgCfg) … … 1124 1194 if (RT_FAILURE(rc)) 1125 1195 break; 1196 dbgdiggerOS2FixupMTE(pUVM, pVMM, pThis, &uBuf); 1126 1197 LogRel(("DbgDiggerOs2: Module @ %#010RX32: %.8s %#x %#x\n", (uint32_t)Addr.FlatPtr, 1127 1198 uBuf.mte.mte_modname, uBuf.mte.mte_flags1, uBuf.mte.mte_flags2)); … … 1141 1212 if (RT_SUCCESS(rc)) 1142 1213 { 1214 dbgdiggerOS2FixupMTE(pUVM, pVMM, pThis, &uBuf); 1143 1215 LogRel(("DbgDiggerOs2: Module @ %#010RX32: %.8s %#x %#x [again]\n", (uint32_t)Addr.FlatPtr, 1144 1216 uBuf.mte.mte_modname, uBuf.mte.mte_flags1, uBuf.mte.mte_flags2));
Note:
See TracChangeset
for help on using the changeset viewer.