[Lldb-commits] [lldb] [lldb-dap] Do not take ownership of stdin. (PR #133811)

via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 31 15:15:35 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: John Harrison (ashgti)

<details>
<summary>Changes</summary>

There isn't any benefit to taking ownership of stdin and it may cause issues if `Transport` is dealloced.

---
Full diff: https://github.com/llvm/llvm-project/pull/133811.diff


1 Files Affected:

- (modified) lldb/tools/lldb-dap/lldb-dap.cpp (+1-1) 


``````````diff
diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index 062c3a5f989f3..a1d4f4f92e625 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -571,7 +571,7 @@ int main(int argc, char *argv[]) {
   }
 
   lldb::IOObjectSP input = std::make_shared<NativeFile>(
-      fileno(stdin), File::eOpenOptionReadOnly, true);
+      fileno(stdin), File::eOpenOptionReadOnly, false);
   lldb::IOObjectSP output = std::make_shared<NativeFile>(
       stdout_fd, File::eOpenOptionWriteOnly, false);
 

``````````

</details>


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


More information about the lldb-commits mailing list