summaryrefslogtreecommitdiff
path: root/view/sharedcache
diff options
context:
space:
mode:
authorkat <kat@vector35.com>2024-11-06 11:10:01 -0500
committerGalen Williamson <galen@vector35.com>2024-11-06 13:04:15 -0500
commit30753ee362f782c6fc4e96dfc1a854983f67e48c (patch)
tree17c6835f2c97f20637db018196928738aa5eda24 /view/sharedcache
parent62f2addc577d1a202907527ad3c5a2135b5db0eb (diff)
[SharedCache] Fix bndb save/load within projects
Diffstat (limited to 'view/sharedcache')
-rw-r--r--view/sharedcache/core/SharedCache.cpp10
-rw-r--r--view/sharedcache/core/VM.cpp5
2 files changed, 10 insertions, 5 deletions
diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp
index 4d0f0046..ccc9ec30 100644
--- a/view/sharedcache/core/SharedCache.cpp
+++ b/view/sharedcache/core/SharedCache.cpp
@@ -155,7 +155,7 @@ uint64_t SharedCache::FastGetBackingCacheCount(BinaryNinja::Ref<BinaryNinja::Bin
baseFile = MMappedFileAccessor::Open(dscView, dscView->GetFile()->GetSessionId(), dscView->GetFile()->GetOriginalFilename())->lock();
}
catch (...){
- LogError("SharedCache preload: Failed to open file");
+ LogError("SharedCache preload: Failed to open file %s", dscView->GetFile()->GetOriginalFilename().c_str());
return 0;
}
@@ -261,7 +261,7 @@ void SharedCache::PerformInitialLoad()
dyld_cache_mapping_info mapping {};
BackingCache cache;
cache.isPrimary = true;
- cache.path = baseFile->Path();
+ cache.path = path;
for (size_t i = 0; i < primaryCacheHeader.mappingCount; i++)
{
@@ -329,7 +329,7 @@ void SharedCache::PerformInitialLoad()
BackingCache cache;
cache.isPrimary = true;
- cache.path = baseFile->Path();
+ cache.path = path;
for (size_t i = 0; i < primaryCacheHeader.mappingCount; i++)
{
@@ -440,7 +440,7 @@ void SharedCache::PerformInitialLoad()
// briefly.
BackingCache cache;
cache.isPrimary = true;
- cache.path = baseFile->Path();
+ cache.path = path;
for (size_t i = 0; i < primaryCacheHeader.mappingCount; i++)
{
@@ -566,7 +566,7 @@ void SharedCache::PerformInitialLoad()
BackingCache cache;
cache.isPrimary = true;
- cache.path = baseFile->Path();
+ cache.path = path;
for (size_t i = 0; i < primaryCacheHeader.mappingCount; i++)
{
diff --git a/view/sharedcache/core/VM.cpp b/view/sharedcache/core/VM.cpp
index 32d6c938..0271ed7f 100644
--- a/view/sharedcache/core/VM.cpp
+++ b/view/sharedcache/core/VM.cpp
@@ -110,6 +110,11 @@ std::string ResolveFilePath(BinaryNinja::Ref<BinaryNinja::BinaryView> dscView, c
}
}
+ if (dscView->GetFile()->GetProjectFile())
+ {
+ BinaryNinja::LogError("Failed to resolve file path for %s", path.c_str());
+ }
+
// If we couldn't find a sibling filename, just return the path we were given
return path;
}