| 290 | } |
| 291 | |
| 292 | void DbgHotScanner::ScanRoot(addr_target rootPtr, int memKind) |
| 293 | { |
| 294 | mDebugger->ReadMemory(rootPtr, sizeof(mRoot), &mRoot); |
| 295 | |
| 296 | #ifdef BF_DBG_32 |
| 297 | for (int rootIdx = 0; rootIdx < PageHeap::PageMap::ROOT_LENGTH; rootIdx++) |
| 298 | { |
| 299 | addr_target nodeAddr = mRoot.ptrs[rootIdx]; |
| 300 | if (nodeAddr == 0) |
| 301 | continue; |
| 302 | mDebugger->ReadMemory(nodeAddr, sizeof(mNode), &mNode); |
| 303 | for (int leafIdx = 0; leafIdx < PageHeap::PageMap::LEAF_LENGTH; leafIdx++) |
| 304 | { |
| 305 | addr_target spanAddr = mNode.ptrs[leafIdx]; |
| 306 | if (spanAddr == 0) |
| 307 | continue; |
| 308 | |
| 309 | int expectedStartPage = (rootIdx * PageHeap::PageMap::LEAF_LENGTH) + leafIdx; |
| 310 | TCFake::Span span; |
| 311 | mDebugger->ReadMemory(spanAddr, sizeof(span), &span); |
| 312 | ScanSpan(&span, expectedStartPage, memKind); |
| 313 | } |
| 314 | } |
| 315 | #else |
| 316 | int bits = PageHeap::PageMap::BITS; |
| 317 | int interiorLen = PageHeap::PageMap::INTERIOR_LENGTH; |
| 318 | int leafLen = PageHeap::PageMap::LEAF_LENGTH; |
| 319 | |
| 320 | for (int pageIdx1 = 0; pageIdx1 < PageHeap::PageMap::INTERIOR_LENGTH; pageIdx1++) |
| 321 | { |
| 322 | addr_target node1Addr = mRoot.ptrs[pageIdx1]; |
| 323 | if (node1Addr == 0) |
| 324 | continue; |
| 325 | mDebugger->ReadMemory(node1Addr, sizeof(mNode1), &mNode1); |
| 326 | for (int pageIdx2 = 0; pageIdx2 < PageHeap::PageMap::INTERIOR_LENGTH; pageIdx2++) |
| 327 | { |
| 328 | addr_target node2Addr = mNode1.ptrs[pageIdx2]; |
| 329 | if (node2Addr == 0) |
| 330 | continue; |
| 331 | mDebugger->ReadMemory(node2Addr, sizeof(mNode2), &mNode2); |
| 332 | for (int pageIdx3 = 0; pageIdx3 < PageHeap::PageMap::LEAF_LENGTH; pageIdx3++) |
| 333 | { |
| 334 | addr_target spanAddr = mNode2.ptrs[pageIdx3]; |
| 335 | if (spanAddr == 0) |
| 336 | continue; |
| 337 | |
| 338 | int expectedStartPage = ((pageIdx1 * PageHeap::PageMap::INTERIOR_LENGTH) + pageIdx2) * PageHeap::PageMap::LEAF_LENGTH + pageIdx3; |
| 339 | TCFake::Span span; |
| 340 | mDebugger->ReadMemory(spanAddr, sizeof(span), &span); |
| 341 | ScanSpan(&span, expectedStartPage, memKind); |
| 342 | } |
| 343 | } |
| 344 | } |
| 345 | #endif |
| 346 | } |
| 347 | |
| 348 | void DbgHotScanner::Scan(DbgHotResolveFlags flags) |
| 349 | { |
nothing calls this directly
no test coverage detected