@@ -63,13 +63,15 @@ static std::shared_ptr<const fml::Mapping> SearchMapping(
6363 // invalid mapping. If all the other methods for resolving the data also
6464 // fail, the engine will stop with accompanying error logs.
6565 if (auto mapping = embedder_mapping_callback ()) {
66+ FML_LOG (ERROR) << " SearchMapping: return mapping" ;
6667 return mapping;
6768 }
6869 }
6970
7071 // Attempt to open file at path specified.
7172 if (!file_path.empty ()) {
7273 if (auto file_mapping = GetFileMapping (file_path, is_executable)) {
74+ FML_LOG (ERROR) << " SearchMapping: return file_mapping" ;
7375 return file_mapping;
7476 }
7577 }
@@ -80,6 +82,8 @@ static std::shared_ptr<const fml::Mapping> SearchMapping(
8082 auto symbol_mapping = std::make_unique<const fml::SymbolMapping>(
8183 native_library, native_library_symbol_name);
8284 if (symbol_mapping->GetMapping () != nullptr ) {
85+ FML_LOG (ERROR)
86+ << " SearchMapping: return symbol_mapping (native library path)" ;
8387 return symbol_mapping;
8488 }
8589 }
@@ -90,24 +94,38 @@ static std::shared_ptr<const fml::Mapping> SearchMapping(
9094 auto symbol_mapping = std::make_unique<const fml::SymbolMapping>(
9195 loaded_process, native_library_symbol_name);
9296 if (symbol_mapping->GetMapping () != nullptr ) {
97+ FML_LOG (ERROR)
98+ << " SearchMapping: return symbol_mapping (current process)" ;
9399 return symbol_mapping;
94100 }
95101 }
96102
103+ FML_LOG (ERROR) << " SearchMapping: return nullptr" ;
97104 return nullptr ;
98105}
99106
100107#endif // !DART_SNAPSHOT_STATIC_LINK
101108
102109static std::shared_ptr<const fml::Mapping> ResolveVMData (
103110 const Settings& settings) {
111+ FML_LOG (ERROR) << " static ResolveVMData(settings)" ;
104112#if DART_SNAPSHOT_STATIC_LINK
113+ FML_LOG (ERROR) << " Static link" ;
105114 return std::make_unique<fml::NonOwnedMapping>(kDartVmSnapshotData ,
106115 0 , // size
107116 nullptr , // release_func
108117 true // dontneed_safe
109118 );
110119#else // DART_SNAPSHOT_STATIC_LINK
120+ FML_LOG (ERROR) << " Not static link; search mapping" ;
121+ FML_LOG (ERROR) << " settings.vm_snapshot_data: "
122+ << static_cast <bool >(settings.vm_snapshot_data );
123+ FML_LOG (ERROR) << " settings.vm_snapshot_data_path: "
124+ << settings.vm_snapshot_data_path ;
125+ FML_LOG (ERROR) << " settings.application_library_path: " ;
126+ for (const auto & path : settings.application_library_path ) {
127+ FML_LOG (ERROR) << " - " << path;
128+ }
111129 return SearchMapping (
112130 settings.vm_snapshot_data , // embedder_mapping_callback
113131 settings.vm_snapshot_data_path , // file_path
@@ -186,6 +204,7 @@ fml::RefPtr<const DartSnapshot> DartSnapshot::VMSnapshotFromSettings(
186204 if (snapshot->IsValid ()) {
187205 return snapshot;
188206 }
207+ FML_LOG (ERROR) << " Snapshot not valid" ;
189208 return nullptr ;
190209}
191210
0 commit comments