MCPcopy Create free account
hub / github.com/beefytech/Beef / UnloadDyn

Method UnloadDyn

IDEHelper/DebugTarget.cpp:250–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250String DebugTarget::UnloadDyn(addr_target imageBase)
251{
252 String filePath;
253
254 //AutoDbgTime dbgTime("DebugTarget::UnloadDyn");
255
256 for (int i = 0; i < (int)mDbgModules.size(); i++)
257 {
258 DbgModule* dwarf = mDbgModules[i];
259 if (dwarf->mImageBase == imageBase)
260 {
261 dwarf->mDeleting = true;
262 dwarf->RemoveTargetData();
263 RemoveTargetData();
264 filePath = dwarf->mFilePath;
265
266 if (mTargetBinary == dwarf)
267 {
268 mTargetBinary = NULL;
269 delete mHotHeap;
270 mHotHeap = NULL;
271
272 if (mHotHeapAddr != 0)
273 {
274 BfLogDbg("VirtualFreeEx %p %d\n", mHotHeapAddr, mHotHeapReserveSize);
275 ::VirtualFreeEx(mDebugger->mProcessInfo.hProcess, (void*)(intptr)mHotHeapAddr, 0, MEM_RELEASE);
276 mHotHeapAddr = 0;
277 }
278 }
279
280 ClearFindDbgModuleCache();
281 mDbgModules.RemoveAt(i);
282 bool success = mDbgModuleMap.Remove(dwarf->mId);
283 BF_ASSERT_REL(success);
284
285 delete dwarf;
286 return filePath;
287 }
288 }
289
290 return "";
291}
292
293void DebugTarget::CleanupHotHeap()
294{

Callers 1

DoUpdateMethod · 0.80

Calls 4

sizeMethod · 0.45
RemoveTargetDataMethod · 0.45
RemoveAtMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected