[Lldb-commits] [lldb] [lldb-dap] Allow setting scoped enums values (PR #192028)
Ebuka Ezike via lldb-commits
lldb-commits at lists.llvm.org
Fri Apr 17 11:50:16 PDT 2026
================
@@ -64,7 +64,14 @@ SetVariableRequestHandler::Run(const SetVariableArguments &args) const {
lldb::SBFrame frame = variable.GetFrame();
std::string expression = llvm::StringRef(args.value).trim().str();
lldb::SBValue result = EvaluateExpression(dap.target, frame, expression);
- const char *value = result.IsValid() ? result.GetValue() : expression.c_str();
+ const char *value = [&]() {
+ if (!result.IsValid())
+ return expression.c_str();
+ lldb::SBType type = result.GetType();
+ if (type.IsScopedEnumerationType())
----------------
da-viper wrote:
The `IsScopedEnumerationType` is not yet implemented for swift. but It should be a scoped enum as it is implemented as a struct in the dwarf information.
this [PR](https://github.com/llvm/llvm-project/pull/192711) should mark the c++ enums as scalar types. an can use that here to check if it is a scalar type.
I don't have a strong preference on either as both languages (swift/ rust) are not upstream and it works for their current implementation.
https://github.com/llvm/llvm-project/pull/192028
More information about the lldb-commits
mailing list