[Lldb-commits] [lldb] [lldb-dap] Refactoring lldb-dap 'launch' request to use typed RequestHandler<>. (PR #133624)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 24 18:56:15 PDT 2025


================
@@ -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;
----------------
JDevlieghere wrote:

Right, so in the case where the user didn't specify anything, I'm arguing we shouldn't treat it the same as if it was set to false. Unless the spec says that it being absent should be treated as it being set to false. The code snippet you're pointing out is exactly what I'm worried about: some of these things are set by default and the implementation here shouldn't have to worry about that.

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


More information about the lldb-commits mailing list