|
21 | 21 | #include "lldb/Core/Telemetry.h" |
22 | 22 | #include "lldb/DataFormatters/DataVisualization.h" |
23 | 23 | #include "lldb/Expression/REPL.h" |
| 24 | +#include "lldb/Host/Config.h" |
24 | 25 | #include "lldb/Host/File.h" |
25 | 26 | #include "lldb/Host/FileSystem.h" |
26 | 27 | #include "lldb/Host/HostInfo.h" |
27 | 28 | #include "lldb/Host/StreamFile.h" |
28 | 29 | #include "lldb/Host/Terminal.h" |
29 | 30 | #include "lldb/Host/ThreadLauncher.h" |
| 31 | +#include "lldb/Host/XML.h" |
30 | 32 | #include "lldb/Interpreter/CommandInterpreter.h" |
31 | 33 | #include "lldb/Interpreter/CommandReturnObject.h" |
32 | 34 | #include "lldb/Interpreter/OptionValue.h" |
@@ -2442,3 +2444,56 @@ llvm::ThreadPoolInterface &Debugger::GetThreadPool() { |
2442 | 2444 | "Debugger::GetThreadPool called before Debugger::Initialize"); |
2443 | 2445 | return *g_thread_pool; |
2444 | 2446 | } |
| 2447 | + |
| 2448 | +static void AddBoolConfigEntry(StructuredData::Dictionary &dict, |
| 2449 | + llvm::StringRef name, bool value, |
| 2450 | + llvm::StringRef description) { |
| 2451 | + auto entry_up = std::make_unique<StructuredData::Dictionary>(); |
| 2452 | + entry_up->AddBooleanItem("value", value); |
| 2453 | + entry_up->AddStringItem("description", description); |
| 2454 | + dict.AddItem(name, std::move(entry_up)); |
| 2455 | +} |
| 2456 | + |
| 2457 | +static void AddLLVMTargets(StructuredData::Dictionary &dict) { |
| 2458 | + auto array_up = std::make_unique<StructuredData::Array>(); |
| 2459 | +#define LLVM_TARGET(target) \ |
| 2460 | + array_up->AddItem(std::make_unique<StructuredData::String>(#target)); |
| 2461 | +#include "llvm/Config/Targets.def" |
| 2462 | + auto entry_up = std::make_unique<StructuredData::Dictionary>(); |
| 2463 | + entry_up->AddItem("value", std::move(array_up)); |
| 2464 | + entry_up->AddStringItem("description", "A list of configured LLVM targets."); |
| 2465 | + dict.AddItem("targets", std::move(entry_up)); |
| 2466 | +} |
| 2467 | + |
| 2468 | +StructuredData::DictionarySP Debugger::GetBuildConfiguration() { |
| 2469 | + auto config_up = std::make_unique<StructuredData::Dictionary>(); |
| 2470 | + AddBoolConfigEntry( |
| 2471 | + *config_up, "xml", XMLDocument::XMLEnabled(), |
| 2472 | + "A boolean value that indicates if XML support is enabled in LLDB"); |
| 2473 | + AddBoolConfigEntry( |
| 2474 | + *config_up, "curl", LLVM_ENABLE_CURL, |
| 2475 | + "A boolean value that indicates if CURL support is enabled in LLDB"); |
| 2476 | + AddBoolConfigEntry( |
| 2477 | + *config_up, "curses", LLDB_ENABLE_CURSES, |
| 2478 | + "A boolean value that indicates if curses support is enabled in LLDB"); |
| 2479 | + AddBoolConfigEntry( |
| 2480 | + *config_up, "editline", LLDB_ENABLE_LIBEDIT, |
| 2481 | + "A boolean value that indicates if editline support is enabled in LLDB"); |
| 2482 | + AddBoolConfigEntry(*config_up, "editline_wchar", LLDB_EDITLINE_USE_WCHAR, |
| 2483 | + "A boolean value that indicates if editline wide " |
| 2484 | + "characters support is enabled in LLDB"); |
| 2485 | + AddBoolConfigEntry( |
| 2486 | + *config_up, "lzma", LLDB_ENABLE_LZMA, |
| 2487 | + "A boolean value that indicates if lzma support is enabled in LLDB"); |
| 2488 | + AddBoolConfigEntry( |
| 2489 | + *config_up, "python", LLDB_ENABLE_PYTHON, |
| 2490 | + "A boolean value that indicates if python support is enabled in LLDB"); |
| 2491 | + AddBoolConfigEntry( |
| 2492 | + *config_up, "lua", LLDB_ENABLE_LUA, |
| 2493 | + "A boolean value that indicates if lua support is enabled in LLDB"); |
| 2494 | + AddBoolConfigEntry(*config_up, "fbsdvmcore", LLDB_ENABLE_FBSDVMCORE, |
| 2495 | + "A boolean value that indicates if fbsdvmcore support is " |
| 2496 | + "enabled in LLDB"); |
| 2497 | + AddLLVMTargets(*config_up); |
| 2498 | + return config_up; |
| 2499 | +} |
0 commit comments