diff options
| author | Pavel Labath <labath@google.com> | 2018-06-28 14:23:04 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2018-06-28 14:23:04 +0000 |
| commit | abc0c6ad09129001d87e9373e9e5020dd20f7f2a (patch) | |
| tree | b29ad4bb3cab5f31e463591da4b04a5be98f9421 /lldb/source/API | |
| parent | 3c7b58d6b13f379549d81da6e4f41fdccf5db231 (diff) | |
| download | bcm5719-llvm-abc0c6ad09129001d87e9373e9e5020dd20f7f2a.tar.gz bcm5719-llvm-abc0c6ad09129001d87e9373e9e5020dd20f7f2a.zip | |
Skip core file tests on build configurations lacking necessary components
Summary:
To successfully open a core file, we need to have LLVM built with
support for the relevant target. Right now, if one does not have the
appropriate targets configured, the tests will fail.
This patch uses the GetBuildConfiguration SB API to inform the test (and
anyone else who cares) about the list of supported LLVM targets. The
test then uses this information to approriately skip the tests.
Reviewers: clayborg, jingham
Subscribers: martong, lldb-commits
Differential Revision: https://reviews.llvm.org/D48641
llvm-svn: 335859
Diffstat (limited to 'lldb/source/API')
| -rw-r--r-- | lldb/source/API/SBDebugger.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp index 526b2bd8a00..a651141003a 100644 --- a/lldb/source/API/SBDebugger.cpp +++ b/lldb/source/API/SBDebugger.cpp @@ -500,11 +500,23 @@ static void AddBoolConfigEntry(StructuredData::Dictionary &dict, dict.AddItem(name, std::move(entry_up)); } +static void AddLLVMTargets(StructuredData::Dictionary &dict) { + auto array_up = llvm::make_unique<StructuredData::Array>(); +#define LLVM_TARGET(target) \ + array_up->AddItem(llvm::make_unique<StructuredData::String>(#target)); +#include "llvm/Config/Targets.def" + auto entry_up = llvm::make_unique<StructuredData::Dictionary>(); + entry_up->AddItem("value", std::move(array_up)); + entry_up->AddStringItem("description", "A list of configured LLVM targets."); + dict.AddItem("targets", std::move(entry_up)); +} + SBStructuredData SBDebugger::GetBuildConfiguration() { auto config_up = llvm::make_unique<StructuredData::Dictionary>(); AddBoolConfigEntry( *config_up, "xml", XMLDocument::XMLEnabled(), "A boolean value that indicates if XML support is enabled in LLDB"); + AddLLVMTargets(*config_up); SBStructuredData data; data.m_impl_up->SetObjectSP(std::move(config_up)); |

