Improve the posix core file triple detection
authorTamas Berghammer <tberghammer@google.com>
Sat, 4 Nov 2017 18:25:51 +0000 (18:25 +0000)
committerTamas Berghammer <tberghammer@google.com>
Sat, 4 Nov 2017 18:25:51 +0000 (18:25 +0000)
commit7cb7df2bbf4a77091ae40f6f2cfcb05076bb19d0
treea9223980d7fa62f407bd4472b5eb78e92eb0ed40
parente5d44cefea140226185e9e80cdfbcb4492f30427
Improve the posix core file triple detection

Summary:
Posix core files sometime don't contain enough information to correctly
detect the OS. If that is the case we should use the OS from the target
instead as it will contain usable information in more cases and if the
target and the core contain different OS-es then we are already in a
pretty bad state so moving from an unknown OS to a known (but possibly
incorrect) OS will do no harm.

We already had similar code in place for MIPS. This change tries to make
it more generic by using ArchSpec::MergeFrom and extends it to all
architectures but some MIPS specific issue prevent us from getting rid
of special casing MIPS.

Reviewers: clayborg, nitesh.jain

Subscribers: aemerson, sdardis, arichardson, kristof.beyls, lldb-commits

Differential Revision: https://reviews.llvm.org/D36046

llvm-svn: 317411
lldb/source/Core/ArchSpec.cpp
lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp