MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / SaveCacheInfoToKCView

Method SaveCacheInfoToKCView

view/kernelcache/core/KernelCache.cpp:1957–1979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1955
1956
1957bool KernelCache::SaveCacheInfoToKCView(std::lock_guard<std::mutex>&)
1958{
1959 if (!m_cacheInfo)
1960 return false;
1961
1962 // The initial load should only populate `m_cacheInfo` and should not modify any state.
1963 assert(m_modifiedState->loadedImages.size() == 0);
1964
1965 auto data = m_cacheInfo->AsMetadata();
1966 m_kcView->StoreMetadata(KernelCacheMetadata::Tag, data);
1967 m_kcView->GetParentView()->StoreMetadata(KernelCacheMetadata::Tag, data);
1968
1969 {
1970 std::lock_guard lock(m_viewSpecificState->cacheInfoMutex);
1971 if (m_cacheInfo && !m_viewSpecificState->cacheInfo)
1972 m_viewSpecificState->cacheInfo = m_cacheInfo;
1973 else if (m_cacheInfo != m_viewSpecificState->cacheInfo)
1974 abort();
1975 }
1976
1977 m_metadataValid = true;
1978 return true;
1979}
1980
1981
1982bool KernelCache::SaveModifiedStateToKCView(std::lock_guard<std::mutex>&)

Callers

nothing calls this directly

Calls 4

AsMetadataMethod · 0.80
GetParentViewMethod · 0.80
sizeMethod · 0.45
StoreMetadataMethod · 0.45

Tested by

no test coverage detected