ArchSpec: fix unintentional promotion of unspecified unknowns to specified unknowns
* ArchSpec::MergeFrom() would erroneously promote an unspecified
unknown to a specified unknown when both the ArchSpec and the merged
in ArchSpec were both unspecified unknowns. This no longer happens,
which fixes issues with global module cache lookup in some
situations.
* Added ArchSpec::DumpTriple(Stream&) that now properly prints
unspecified unknowns as '*' and specified unknows as 'unknown'.
This makes it trivial to tell the difference between the two.
Converted printing code over ot using DumpTriple() rather than
building from scratch.
* Fixed up a couple places that were not guaranteeing that an
unspecified unknown was recorded as such.
llvm-svn: 250253
diff --git a/lldb/source/Target/TargetList.cpp b/lldb/source/Target/TargetList.cpp
index 552e951..af596f7 100644
--- a/lldb/source/Target/TargetList.cpp
+++ b/lldb/source/Target/TargetList.cpp
@@ -179,9 +179,14 @@
}
else
{
+ StreamString platform_arch_strm;
+ StreamString module_arch_strm;
+
+ platform_arch.DumpTriple(platform_arch_strm);
+ matching_module_spec.GetArchitecture().DumpTriple(module_arch_strm);
error.SetErrorStringWithFormat("the specified architecture '%s' is not compatible with '%s' in '%s'",
- platform_arch.GetTriple().str().c_str(),
- matching_module_spec.GetArchitecture().GetTriple().str().c_str(),
+ platform_arch_strm.GetString().c_str(),
+ module_arch_strm.GetString().c_str(),
module_spec.GetFileSpec().GetPath().c_str());
return error;
}