@@ -476,13 +476,10 @@ static bool HasReflectionInfo(ObjectFile *obj_file) {
476
476
StringRef reflstr =
477
477
obj_file_format_up->getSectionName (swift::ReflectionSectionKind::reflstr);
478
478
479
- bool hasReflectionSection = false ;
480
- hasReflectionSection |= findSectionInObject (field_md);
481
- hasReflectionSection |= findSectionInObject (assocty);
482
- hasReflectionSection |= findSectionInObject (builtin);
483
- hasReflectionSection |= findSectionInObject (capture);
484
- hasReflectionSection |= findSectionInObject (typeref);
485
- hasReflectionSection |= findSectionInObject (reflstr);
479
+ bool hasReflectionSection =
480
+ findSectionInObject (field_md) || findSectionInObject (assocty) ||
481
+ findSectionInObject (builtin) || findSectionInObject (capture) ||
482
+ findSectionInObject (typeref) || findSectionInObject (reflstr);
486
483
return hasReflectionSection;
487
484
}
488
485
@@ -888,14 +885,18 @@ bool SwiftLanguageRuntimeImpl::AddModuleToReflectionContext(
888
885
889
886
if (load_ptr == 0 || load_ptr == LLDB_INVALID_ADDRESS) {
890
887
if (obj_file->GetType () != ObjectFile::eTypeJIT)
891
- if (Log *log = GetLog (LLDBLog::Types))
892
- log->Printf (" %s: failed to get start address for %s." , __FUNCTION__,
893
- obj_file->GetFileSpec ().GetFilename ().GetCString ());
888
+ LLDB_LOG (GetLog (LLDBLog::Types),
889
+ " {0}: failed to get start address for \" {1}\" ." , __FUNCTION__,
890
+ module_sp->GetObjectName ()
891
+ ? module_sp->GetObjectName ()
892
+ : obj_file->GetFileSpec ().GetFilename ());
894
893
return false ;
895
894
}
896
895
bool found = HasReflectionInfo (obj_file);
897
- LLDB_LOGF (GetLog (LLDBLog::Types), " %s reflection metadata in \" %s\" " ,
898
- found ? " Adding" : " No" , obj_file->GetFileSpec ().GetPath ().c_str ());
896
+ LLDB_LOG (GetLog (LLDBLog::Types), " {0} reflection metadata in \" {1}\" " ,
897
+ found ? " Adding" : " No" ,
898
+ module_sp->GetObjectName () ? module_sp->GetObjectName ()
899
+ : obj_file->GetFileSpec ().GetFilename ());
899
900
if (!found)
900
901
return true ;
901
902
@@ -925,8 +926,14 @@ bool SwiftLanguageRuntimeImpl::AddModuleToReflectionContext(
925
926
likely_module_names);
926
927
}
927
928
928
- if (info_id)
929
- if (auto *swift_metadata_cache = GetSwiftMetadataCache ())
929
+ if (!info_id) {
930
+ LLDB_LOG (GetLog (LLDBLog::Types),
931
+ " Error while loading reflection metadata in \" {0}\" " ,
932
+ module_sp->GetObjectName ());
933
+ return false ;
934
+ }
935
+
936
+ if (auto *swift_metadata_cache = GetSwiftMetadataCache ())
930
937
swift_metadata_cache->registerModuleWithReflectionInfoID (module_sp,
931
938
*info_id);
932
939
0 commit comments