================
@@ -23,7 +25,26 @@ using namespace llvm;
 using namespace lldb_dap;
 using namespace lldb_dap::protocol;
 
-namespace lldb_dap {
+static lldb::LanguageType GetLanguage(lldb::SBDebugger &debugger) {
+  const lldb::SBStructuredData string_result =
+      debugger.GetSetting("target.language");
+
+  return lldb::SBLanguageRuntime::GetLanguageTypeFromString(
+      GetStringValue(string_result).c_str());
+}
+
+static lldb::DynamicValueType
+GetPreferDynamicValue(lldb::SBDebugger &debugger) {
+  const lldb::SBStructuredData string_result =
+      debugger.GetSetting("target.prefer-dynamic-value");
+
+  return llvm::StringSwitch<lldb::DynamicValueType>(
+             GetStringValue(string_result))
+      .Case("no-dynamic-values", lldb::eNoDynamicValues)
+      .Case("run-target", lldb::eDynamicCanRunTarget)
+      .Case("no-run-target", lldb::eDynamicDontRunTarget)
+      .Default(lldb::eDynamicDontRunTarget);
+}
----------------
DrSergei wrote:

I think it would be better to extend `SBTarget` class with these methods, 
because underlying `lldb_private::Target` class already has them to avoid 
duplicate work

https://github.com/llvm/llvm-project/pull/214746
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to