================
@@ -37,14 +39,12 @@ MakeArgv(const llvm::ArrayRef<std::string> &strs) {
   return argv;
 }
 
-static uint32_t SetLaunchFlag(uint32_t flags, const llvm::json::Object *obj,
-                              llvm::StringRef key, lldb::LaunchFlags mask) {
-  if (const auto opt_value = GetBoolean(obj, key)) {
-    if (*opt_value)
-      flags |= mask;
-    else
-      flags &= ~mask;
-  }
+static uint32_t SetLaunchFlag(uint32_t flags, bool flag,
+                              lldb::LaunchFlags mask) {
+  if (flag)
+    flags |= mask;
+  else
+    flags &= ~mask;
----------------
ashgti wrote:

I'm not sure I understand this issue. For example, the `disableASLR`. If a user 
launched with:

```json
{
  "type": "lldb-dap",
  "request": "launch",
  "name": "Debug a.out",
  "program": "a.out"
}
```

This would default to `stopOnEntry == false`.

If the user launched with:

```json
{
  "type": "lldb-dap",
  "request": "launch",
  "name": "Debug a.out",
  "program": "a.out",
  "stopOnEntry": false
}
```

This would also set `stopOnEntry == false`.

If a user launched with:

```json
{
  "type": "lldb-dap",
  "request": "launch",
  "name": "Debug a.out",
  "program": "a.out",
  "stopOnEntry": true
}
```

This would result in `stopOnEntry == true`.

I guess the only complicated example is the `disableASLR` flag because that is 
enabled by default because of 
https://github.com/llvm/llvm-project/blob/af63e1b505453de3e6a281d1b72e62fa8d396b23/lldb/source/API/SBLaunchInfo.cpp#L47
 so its flag that is defaulted to `true` implicitly. But I made the default 
value `true` for that field, so it should be handled correctly.


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

Reply via email to