Skip to content

Conversation

@ashgti
Copy link
Contributor

@ashgti ashgti commented Mar 6, 2025

Updating the naming and adding documentation to better follow the style guide.

Updating the naming and adding documentation to better follow the style guide.
@ashgti ashgti marked this pull request as ready for review March 6, 2025 23:17
@ashgti ashgti requested a review from JDevlieghere as a code owner March 6, 2025 23:17
@llvmbot
Copy link
Member

llvmbot commented Mar 6, 2025

@llvm/pr-subscribers-lldb

Author: John Harrison (ashgti)

Changes

Updating the naming and adding documentation to better follow the style guide.


Full diff: https://github.com/llvm/llvm-project/pull/130202.diff

2 Files Affected:

  • (modified) lldb/tools/lldb-dap/OutputRedirector.cpp (+3-3)
  • (modified) lldb/tools/lldb-dap/OutputRedirector.h (+7-1)
diff --git a/lldb/tools/lldb-dap/OutputRedirector.cpp b/lldb/tools/lldb-dap/OutputRedirector.cpp
index 9ff25ad4149dd..fe278faca87bf 100644
--- a/lldb/tools/lldb-dap/OutputRedirector.cpp
+++ b/lldb/tools/lldb-dap/OutputRedirector.cpp
@@ -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;
diff --git a/lldb/tools/lldb-dap/OutputRedirector.h b/lldb/tools/lldb-dap/OutputRedirector.h
index 45571c0d5f344..77b1b76ec4d89 100644
--- a/lldb/tools/lldb-dap/OutputRedirector.h
+++ b/lldb/tools/lldb-dap/OutputRedirector.h
@@ -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();

@ashgti ashgti merged commit 2894719 into llvm:main Mar 7, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants