Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lldb/tools/lldb-dap/OutputRedirector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion lldb/tools/lldb-dap/OutputRedirector.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ class OutputRedirector {
/// 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();
Expand Down