diff options
author | Todd Fiala <todd.fiala@gmail.com> | 2015-10-13 23:41:19 +0000 |
---|---|---|
committer | Todd Fiala <todd.fiala@gmail.com> | 2015-10-13 23:41:19 +0000 |
commit | 7df337f85c78e64c3fb2d36c859212e8d06f7725 (patch) | |
tree | 15a3679c4ff89174f81de59b3e73546575d3e5a8 /lldb/source/Commands/CommandObjectTarget.cpp | |
parent | a59fcbae4ff25ed039728ac66af0fcf625fa22d4 (diff) | |
download | llvm-7df337f85c78e64c3fb2d36c859212e8d06f7725.zip llvm-7df337f85c78e64c3fb2d36c859212e8d06f7725.tar.gz llvm-7df337f85c78e64c3fb2d36c859212e8d06f7725.tar.bz2 |
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
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 9a84c34..b530517 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -79,7 +79,8 @@ DumpTargetInfo (uint32_t target_idx, Target *target, const char *prefix_cstr, bo uint32_t properties = 0; if (target_arch.IsValid()) { - strm.Printf ("%sarch=%s", properties++ > 0 ? ", " : " ( ", target_arch.GetTriple().str().c_str()); + strm.Printf ("%sarch=", properties++ > 0 ? ", " : " ( "); + target_arch.DumpTriple (strm); properties++; } PlatformSP platform_sp (target->GetPlatform()); @@ -1459,15 +1460,18 @@ DumpModuleArchitecture (Stream &strm, Module *module, bool full_triple, uint32_t { if (module) { - const char *arch_cstr; + StreamString arch_strm; + if (full_triple) - arch_cstr = module->GetArchitecture().GetTriple().str().c_str(); + module->GetArchitecture().DumpTriple(arch_strm); else - arch_cstr = module->GetArchitecture().GetArchitectureName(); + arch_strm.PutCString(module->GetArchitecture().GetArchitectureName()); + std::string arch_str = arch_strm.GetString(); + if (width) - strm.Printf("%-*s", width, arch_cstr); + strm.Printf("%-*s", width, arch_str.c_str()); else - strm.PutCString(arch_cstr); + strm.PutCString(arch_str.c_str()); } } |