================
@@ -31,7 +31,18 @@ MakeArgv(const llvm::ArrayRef<std::string> &strs) {
   return argv;
 }
 
-// Both attach and launch take a either a sourcePath or sourceMap
+static uint32_t SetLaunchFlag(uint32_t flags, const llvm::json::Object *obj,
+                              llvm::StringRef key, lldb::LaunchFlags mask,
+                              bool default_value) {
+  if (GetBoolean(obj, key).value_or(default_value))
+    flags |= mask;
+  else
+    flags &= ~mask;
+
+  return flags;
+}
----------------
JDevlieghere wrote:

This still doesn't distinguish between the value not being set and the value 
being set to `true` or `false`. Here's what I was suggesting: 

```suggestion
static uint32_t SetLaunchFlag(uint32_t flags, const llvm::json::Object *obj,
                              llvm::StringRef key, lldb::LaunchFlags mask) {
  if (auto b = GetBoolean(obj, key)) {
    if (*b)
       flags |= mask;
        else
      flags &= ~mask;
  }
  return flags;
}
```

https://github.com/llvm/llvm-project/pull/129753
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to