| 245 | } |
| 246 | |
| 247 | void MiniDumpDebugger::MapMemory(addr_target addr, void* data, intptr_target size) |
| 248 | { |
| 249 | addr_target beginAddress = addr; |
| 250 | addr_target endAddress = addr + size; |
| 251 | |
| 252 | int memSize = (int)(endAddress - beginAddress); |
| 253 | for (int memOffset = 0; true; memOffset += DBG_MAX_LOOKBACK) |
| 254 | { |
| 255 | int curSize = memSize - memOffset; |
| 256 | if (curSize <= 0) |
| 257 | break; |
| 258 | |
| 259 | MiniDumpMemoryRegion* memRegion = mAlloc.Alloc<MiniDumpMemoryRegion>(); |
| 260 | memRegion->mAddress = beginAddress + memOffset; |
| 261 | memRegion->mAddressLength = curSize; |
| 262 | memRegion->mData = (uint8*)data + memOffset; |
| 263 | memRegion->mNext = NULL; |
| 264 | mMemMap.Insert(memRegion); |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | MappedFile* MiniDumpDebugger::MapModule(COFF* dbgModule, const StringImpl& fileName) |
| 269 | { |