[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

Walter Erquinigo via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 22 13:14:58 PST 2025


================
@@ -21,21 +23,22 @@ namespace lldb_dap {
 /// The file is destroyed when the destructor is invoked.
 struct FifoFile {
   FifoFile(llvm::StringRef path);
+  FifoFile(llvm::StringRef path, FILE *f);
+  // FifoFile(llvm::StringRef path, FILE *f);
+  FifoFile(FifoFile &&other);
+
+  FifoFile(const FifoFile &) = delete;
+  FifoFile &operator=(const FifoFile &) = delete;
 
   ~FifoFile();
 
   std::string m_path;
+  FILE *m_file;
 };
 
-/// Create a fifo file in the filesystem.
-///
-/// \param[in] path
-///     The path for the fifo file.
-///
-/// \return
-///     A \a std::shared_ptr<FifoFile> if the file could be created, or an
-///     \a llvm::Error in case of failures.
-llvm::Expected<std::shared_ptr<FifoFile>> CreateFifoFile(llvm::StringRef path);
+std::error_code createNamedPipe(const llvm::Twine &Prefix,
----------------
walter-erquinigo wrote:

This API is unnecessarily complex. The Prefix can just be a StringRef. Also use lower case for names. You also never use the Suffix.
Finally, please write some documentation mentioning that a unique named pipe with the given prefix will be created.
You may consider renaming this function as `createUniqueNamedPipe`

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


More information about the lldb-commits mailing list