[lldb-dap] Updating naming and documentation to follow style guide. (#130202)

Updating the naming and adding documentation to better follow the style
guide.
This commit is contained in:
John Harrison
2025-03-07 06:42:26 +01:00
committed by GitHub
parent ed6bde93f0
commit 2894719314
2 changed files with 10 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ Expected<int> OutputRedirector::GetWriteFileDescriptor() {
return m_fd;
}
Error OutputRedirector::RedirectTo(std::FILE *fileOverride,
Error OutputRedirector::RedirectTo(std::FILE *file_override,
std::function<void(StringRef)> callback) {
assert(m_fd == kInvalidDescriptor && "Output readirector already started.");
int new_fd[2];
@@ -56,8 +56,8 @@ Error OutputRedirector::RedirectTo(std::FILE *fileOverride,
int read_fd = new_fd[0];
m_fd = new_fd[1];
if (fileOverride) {
int override_fd = fileno(fileOverride);
if (file_override) {
int override_fd = fileno(file_override);
// Backup the FD to restore once redirection is complete.
m_original_fd = override_fd;

View File

@@ -24,10 +24,16 @@ public:
/// Creates writable file descriptor that will invoke the given callback on
/// each write in a background thread.
///
/// \param[in] file_override
/// Updates the file descriptor to the redirection pipe, if not null.
///
/// \param[in] callback
/// A callback invoked when any data is written to the file handle.
///
/// \return
/// \a Error::success if the redirection was set up correctly, or an error
/// otherwise.
llvm::Error RedirectTo(std::FILE *overrideFile,
llvm::Error RedirectTo(std::FILE *file_override,
std::function<void(llvm::StringRef)> callback);
llvm::Expected<int> GetWriteFileDescriptor();