[Lldb-commits] [lldb] [lldb] Add SetValueFromCString API to SyntheticFronend (PR #67309)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 25 13:49:13 PDT 2023


================
@@ -1535,7 +1535,12 @@ bool ValueObject::SetValueFromCString(const char *value_str, Status &error) {
     }
   } else {
     // We don't support setting things bigger than a scalar at present.
-    error.SetErrorString("unable to write aggregate data type");
+    // But maybe our frontend knows how to update the value.
+    if (auto *frontend = GetSyntheticFrontend()) {
+      return frontend->SetValueFromCString(value_str, error);
+    } else {
+      error.SetErrorString("unable to write aggregate data type");
+    }
----------------
bulbazord wrote:

llvm style is to avoid braces for single line blocks in if/else/etc.

You can also drop the `else` since it comes after a return.

https://github.com/llvm/llvm-project/pull/67309


More information about the lldb-commits mailing list