Changeset 45984 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 11, 2013 12:46:30 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 85642
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp
r44399 r45984 139 139 int dbgfR3AsInit(PUVM pUVM) 140 140 { 141 Assert(pUVM->pVM); 142 141 143 /* 142 144 * Create the semaphore. … … 144 146 int rc = RTSemRWCreate(&pUVM->dbgf.s.hAsDbLock); 145 147 AssertRCReturn(rc, rc); 148 149 /* 150 * Create the debugging config instance and set it up. 151 */ 152 rc = RTDbgCfgCreate(&pUVM->dbgf.s.hDbgCfg, NULL); 153 AssertRCReturn(rc, rc); 154 155 static struct 156 { 157 RTDBGCFGPROP enmProp; 158 const char *pszEnvName; 159 const char *pszCfgName; 160 } const s_aProps[] = 161 { 162 { RTDBGCFGPROP_FLAGS, "VBOXDBG_FLAGS", "Flags" }, 163 { RTDBGCFGPROP_PATH, "VBOXDBG_PATH", "Path" }, 164 { RTDBGCFGPROP_SUFFIXES, "VBOXDBG_SUFFIXES", "Suffixes" }, 165 { RTDBGCFGPROP_SRC_PATH, "VBOXDBG_SRC_PATH", "SrcPath" }, 166 }; 167 PCFGMNODE pCfgDbgf = CFGMR3GetChild(CFGMR3GetRootU(pUVM), "/DBGF"); 168 for (unsigned i = 0; i < RT_ELEMENTS(s_aProps); i++) 169 { 170 const char *pszEnvValue = RTEnvGet(s_aProps[i].pszEnvName); 171 if (pszEnvValue) 172 { 173 rc = RTDbgCfgChangeString(pUVM->dbgf.s.hDbgCfg, s_aProps[i].enmProp, RTDBGCFGOP_PREPEND, pszEnvValue); 174 if (RT_FAILURE(rc)) 175 return VMR3SetError(pUVM, rc, RT_SRC_POS, 176 "DBGF Config Error: %s=%s -> %Rrc", s_aProps[i].pszEnvName, pszEnvValue, rc); 177 } 178 179 char *pszCfgValue; 180 int rc = CFGMR3QueryStringAllocDef(pCfgDbgf, s_aProps[i].pszCfgName, &pszCfgValue, NULL); 181 if (RT_FAILURE(rc)) 182 return VMR3SetError(pUVM, rc, RT_SRC_POS, 183 "DBGF Config Error: Querying /DBGF/%s -> %Rrc", s_aProps[i].pszCfgName, rc); 184 if (pszCfgValue) 185 { 186 rc = RTDbgCfgChangeString(pUVM->dbgf.s.hDbgCfg, s_aProps[i].enmProp, RTDBGCFGOP_PREPEND, pszCfgValue); 187 if (RT_FAILURE(rc)) 188 return VMR3SetError(pUVM, rc, RT_SRC_POS, 189 "DBGF Config Error: /DBGF/%s=%s -> %Rrc", s_aProps[i].pszCfgName, pszCfgValue, rc); 190 } 191 } 146 192 147 193 /* … … 419 465 { 420 466 RTDBGMOD hDbgMod; 421 int rc = RTDbgModCreateFromImage(&hDbgMod, pszFilename, pszName, 0 /*fFlags*/);467 int rc = RTDbgModCreateFromImage(&hDbgMod, pszFilename, pszName, pVM->pUVM->dbgf.s.hDbgCfg); 422 468 if (RT_SUCCESS(rc)) 423 469 { … … 740 786 741 787 /** 742 * Callback function used by DBGFR3AsLoadImage.743 *744 * @returns VBox status code.745 * @param pszFilename The filename under evaluation.746 * @param pvUser Use arguments (DBGFR3ASLOADOPENDATA).747 */748 static DECLCALLBACK(int) dbgfR3AsLoadImageOpen(const char *pszFilename, void *pvUser)749 {750 DBGFR3ASLOADOPENDATA *pData = (DBGFR3ASLOADOPENDATA *)pvUser;751 return RTDbgModCreateFromImage(&pData->hMod, pszFilename, pData->pszModName, pData->fFlags);752 }753 754 755 /**756 788 * Load symbols from an executable module into the specified address space. 757 789 * … … 785 817 return VERR_INVALID_HANDLE; 786 818 787 /* 788 * Do the work. 789 */ 790 DBGFR3ASLOADOPENDATA Data; 791 Data.pszModName = pszModName; 792 Data.uSubtrahend = 0; 793 Data.fFlags = 0; 794 Data.hMod = NIL_RTDBGMOD; 795 int rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "ImagePath", dbgfR3AsLoadImageOpen, &Data); 796 if (RT_FAILURE(rc)) 797 rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_IMAGE_PATH", dbgfR3AsLoadImageOpen, &Data); 798 if (RT_FAILURE(rc)) 799 rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "Path", dbgfR3AsLoadImageOpen, &Data); 800 if (RT_FAILURE(rc)) 801 rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_PATH", dbgfR3AsLoadImageOpen, &Data); 819 RTDBGMOD hDbgMod; 820 int rc = RTDbgModCreateFromImage(&hDbgMod, pszFilename, pszModName, pUVM->dbgf.s.hDbgCfg); 802 821 if (RT_SUCCESS(rc)) 803 822 { 804 rc = DBGFR3AsLinkModule(pUVM, hRealAS, Data.hMod, pModAddress, iModSeg, 0);823 rc = DBGFR3AsLinkModule(pUVM, hRealAS, hDbgMod, pModAddress, iModSeg, 0); 805 824 if (RT_FAILURE(rc)) 806 RTDbgModRelease( Data.hMod);825 RTDbgModRelease(hDbgMod); 807 826 } 808 827 809 828 RTDbgAsRelease(hRealAS); 810 829 return rc; 811 }812 813 814 /**815 * Callback function used by DBGFR3AsLoadMap.816 *817 * @returns VBox status code.818 * @param pszFilename The filename under evaluation.819 * @param pvUser Use arguments (DBGFR3ASLOADOPENDATA).820 */821 static DECLCALLBACK(int) dbgfR3AsLoadMapOpen(const char *pszFilename, void *pvUser)822 {823 DBGFR3ASLOADOPENDATA *pData = (DBGFR3ASLOADOPENDATA *)pvUser;824 return RTDbgModCreateFromMap(&pData->hMod, pszFilename, pData->pszModName, pData->uSubtrahend, pData->fFlags);825 830 } 826 831 … … 862 867 return VERR_INVALID_HANDLE; 863 868 864 /* 865 * Do the work. 866 */ 867 DBGFR3ASLOADOPENDATA Data; 868 Data.pszModName = pszModName; 869 Data.uSubtrahend = uSubtrahend; 870 Data.fFlags = 0; 871 Data.hMod = NIL_RTDBGMOD; 872 int rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "MapPath", dbgfR3AsLoadMapOpen, &Data); 873 if (RT_FAILURE(rc)) 874 rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_MAP_PATH", dbgfR3AsLoadMapOpen, &Data); 875 if (RT_FAILURE(rc)) 876 rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "Path", dbgfR3AsLoadMapOpen, &Data); 877 if (RT_FAILURE(rc)) 878 rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_PATH", dbgfR3AsLoadMapOpen, &Data); 869 RTDBGMOD hDbgMod; 870 int rc = RTDbgModCreateFromMap(&hDbgMod, pszFilename, pszModName, uSubtrahend, pUVM->dbgf.s.hDbgCfg); 879 871 if (RT_SUCCESS(rc)) 880 872 { 881 rc = DBGFR3AsLinkModule(pUVM, hRealAS, Data.hMod, pModAddress, iModSeg, 0);873 rc = DBGFR3AsLinkModule(pUVM, hRealAS, hDbgMod, pModAddress, iModSeg, 0); 882 874 if (RT_FAILURE(rc)) 883 RTDbgModRelease( Data.hMod);875 RTDbgModRelease(hDbgMod); 884 876 } 885 877 -
trunk/src/VBox/VMM/VMMR3/PATM.cpp
r45620 r45984 4148 4148 return VERR_PATCHING_REFUSED; 4149 4149 4150 #if 0/* DONT COMMIT ENABLED! */4150 #if 1 /* DONT COMMIT ENABLED! */ 4151 4151 /* Blacklisted NT4SP1 areas - debugging why we sometimes crash early on, */ 4152 4152 if ( 0 -
trunk/src/VBox/VMM/include/DBGFInternal.h
r44528 r45984 25 25 #include <iprt/string.h> 26 26 #include <iprt/avl.h> 27 #include <iprt/dbg.h> 27 28 #include <VBox/vmm/dbgf.h> 28 29 … … 307 308 /** Alignment padding. */ 308 309 bool afAlignment1[2]; 310 /** Debug configuration. */ 311 R3PTRTYPE(RTDBGCFG) hDbgCfg; 309 312 310 313 /** The register database lock. */
Note:
See TracChangeset
for help on using the changeset viewer.