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

Method AddAutoStaticEntry

IDEHelper/DebugTarget.cpp:498–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496static const uint64 kAutoStaticBucketPageSize = 1024ull;
497
498void DebugTarget::AddAutoStaticEntry(const DbgAutoStaticEntry& entry)
499{
500 uint64 remainingSize = entry.mAddrLen;
501 uint64 offset = entry.mAddrStart % kAutoStaticBucketPageSize;
502 uint64 curPage = entry.mAddrStart / kAutoStaticBucketPageSize;
503 while (remainingSize > 0)
504 {
505 int bucketIndex = -1;
506
507 /*auto map_iter = mAutoStaticEntryBucketMap.find((addr_target)curPage);
508 if (map_iter != mAutoStaticEntryBucketMap.end())*/
509
510 int* bucketIndexPtr = NULL;
511 if (!mAutoStaticEntryBucketMap.TryAddRaw((addr_target)curPage, NULL, &bucketIndexPtr))
512 {
513 bucketIndex = *bucketIndexPtr;
514 }
515 else
516 {
517 bucketIndex = (int)mAutoStaticEntryBuckets.size();
518 *bucketIndexPtr = bucketIndex;
519 mAutoStaticEntryBuckets.push_back(Array<DbgAutoStaticEntry>());
520 //mAutoStaticEntryBucketMap[(addr_target)curPage] = bucketIndex;
521 }
522
523 mAutoStaticEntryBuckets[bucketIndex].push_back(entry);
524
525 uint64 adjSize = BF_MIN(kAutoStaticBucketPageSize - offset, remainingSize);
526 remainingSize -= adjSize;
527 offset = 0;
528 ++curPage;
529 }
530}
531void DebugTarget::IterateAutoStaticEntries(uint64 memoryRangeStart, uint64 memoryRangeLen, std::function<void(DbgAutoStaticEntry const&)>& func)
532{
533 uint64 remainingSize = memoryRangeLen;

Callers

nothing calls this directly

Calls 3

TryAddRawMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected