[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)
John Harrison via lldb-commits
lldb-commits at lists.llvm.org
Mon Feb 10 09:53:15 PST 2025
================
@@ -21,21 +23,28 @@ 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(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.
+/// Create and open a named pipe with a unique name.
///
-/// \param[in] path
-/// The path for the fifo file.
+/// The arguments have identical meanings to those of
+/// llvm::sys::fs::createTemporaryFile.
///
-/// \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);
+/// Note that the resulting filename is further prepended by \c \\.\pipe\\LOCAL\
+/// on Windows and \c /tmp on other platforms.
+std::error_code createUniqueNamedPipe(const llvm::Twine &prefix,
----------------
ashgti wrote:
Should this return an `llvm::Error` instead of a `std::error_code`? `llvm::Error` has stronger requirements for handling errors.
https://github.com/llvm/llvm-project/pull/121269
More information about the lldb-commits
mailing list