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

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


Author: John Harrison
Date: 2025-03-31T15:51:07-07:00
New Revision: 4492632432190ed8ab3bc39ff8ee5ba9a89256cf

URL: https://github.com/llvm/llvm-project/commit/4492632432190ed8ab3bc39ff8ee5ba9a89256cf
DIFF: https://github.com/llvm/llvm-project/commit/4492632432190ed8ab3bc39ff8ee5ba9a89256cf.diff

LOG: [lldb-dap] Do not take ownership of stdin. (#133811)

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

Added: 
    

Modified: 
    lldb/tools/lldb-dap/lldb-dap.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index 062c3a5f989f3..b91c62e921428 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -571,9 +571,9 @@ int main(int argc, char *argv[]) {
   }
 
   lldb::IOObjectSP input = std::make_shared<NativeFile>(
-      fileno(stdin), File::eOpenOptionReadOnly, true);
+      fileno(stdin), File::eOpenOptionReadOnly, NativeFile::Unowned);
   lldb::IOObjectSP output = std::make_shared<NativeFile>(
-      stdout_fd, File::eOpenOptionWriteOnly, false);
+      stdout_fd, File::eOpenOptionWriteOnly, NativeFile::Unowned);
 
   constexpr llvm::StringLiteral client_name = "stdin/stdout";
   Transport transport(client_name, log.get(), input, output);


        


More information about the lldb-commits mailing list