@@ -106,7 +106,6 @@ enum class CacheEntryType
106106 Primary,
107107 Secondary,
108108 // A special entry that holds symbols for other cache entries.
109- // TODO: We dont need this i think.
110109 Symbols,
111110 // If the type is marked as this then all mappings will be marked as such.
112111 DyldData,
@@ -164,8 +163,6 @@ class CacheEntry
164163// The ID for a given CacheEntry, use this instead of passing a pointer around to avoid complexity :V
165164typedef uint32_t CacheEntryId;
166165
167- // TODO: Add a "ViewCache" that keeps track of what has been added to the view.
168-
169166// The C in DSC.
170167// This represents the entire cache, all regions and images are visible from here.
171168// This is the dump for all the information, and what the workflow activities and the UI want.
@@ -175,10 +172,9 @@ class SharedCache
175172{
176173 // Calculated within `AddEntry`, this indicates where the shared cache image is based at.
177174 uint64_t m_baseAddress = 0 ;
178- // TODO: Figure out when to lock the mutex on this shit lmfao
179175 // The shared cache can own the virtual memory, this is fine...
180176 std::shared_ptr<VirtualMemory> m_vm;
181- std::unordered_map<CacheEntryId, CacheEntry> m_entries {};
177+ std::vector< CacheEntry> m_entries {};
182178 // This information is used in tandem with the cache images to load memory regions into the binary view.
183179 AddressRangeMap<CacheRegion> m_regions {};
184180 // Describes the images of the cache.
@@ -210,7 +206,7 @@ class SharedCache
210206
211207 uint64_t GetBaseAddress () const { return m_baseAddress; }
212208 std::shared_ptr<VirtualMemory> GetVirtualMemory () const { return m_vm; }
213- const std::unordered_map<CacheEntryId, CacheEntry>& GetEntries () const { return m_entries; }
209+ const std::vector< CacheEntry>& GetEntries () const { return m_entries; }
214210 const AddressRangeMap<CacheRegion>& GetRegions () const { return m_regions; }
215211 const std::unordered_map<uint64_t , CacheImage>& GetImages () const { return m_images; }
216212 const std::unordered_map<uint64_t , CacheSymbol>& GetSymbols () const { return m_symbols; }
@@ -226,7 +222,7 @@ class SharedCache
226222
227223 // Adds the cache entry and populates the virtual memory using the mapping information.
228224 // After being added the entry is read only, there is nothing that can modify it.
229- CacheEntryId AddEntry (CacheEntry entry);
225+ void AddEntry (CacheEntry entry);
230226
231227 void ProcessEntryImages (const CacheEntry& entry);
232228
0 commit comments