github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp --
lldb/include/lldb/Host/FileAction.h lldb/source/Host/common/FileAction.cpp
lldb/source/Host/windows/ProcessLauncherWindows.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/tools/lldb-server/lldb-platform.cpp lldb/unittests/Host/HostTest.cpp
--diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lldb/include/lldb/Host/FileAction.h
b/lldb/include/lldb/Host/FileAction.h
index 7d66dbe7f..be68adfd5 100644
--- a/lldb/include/lldb/Host/FileAction.h
+++ b/lldb/include/lldb/Host/FileAction.h
@@ -80,9 +80,10 @@ public:
#ifdef _WIN32
/// Get the Windows handle for this file descriptor.
///
- /// The handle is converted from the file descriptor which is stored
internally.
- /// The initial file descriptor must have been registered in the CRT before.
- void* GetHandle() const;
+ /// The handle is converted from the file descriptor which is stored
+ /// internally. The initial file descriptor must have been registered in the
+ /// CRT before.
+ void *GetHandle() const;
#endif
/// Get the type of action.
@@ -102,8 +103,10 @@ public:
protected:
Action m_action = eFileActionNone; ///< The action for this file.
int m_fd = -1; ///< An existing file descriptor.
- int m_arg = -1; ///< oflag for eFileActionOpen, dup_fd
for eFileActionDuplicate.
- FileSpec m_file_spec; ///< File spec to use for opening after
fork or posix_spawn.
+ int m_arg =
+ -1; ///< oflag for eFileActionOpen, dup_fd for eFileActionDuplicate.
+ FileSpec
+ m_file_spec; ///< File spec to use for opening after fork or posix_spawn.
};
} // namespace lldb_private
diff --git a/lldb/source/Host/windows/ProcessLauncherWindows.cpp
b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
index 8afbf1bf1..cc173823f 100644
--- a/lldb/source/Host/windows/ProcessLauncherWindows.cpp
+++ b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
@@ -246,7 +246,8 @@ llvm::ErrorOr<std::vector<HANDLE>>
ProcessLauncherWindows::GetInheritedHandles(
unique_handles.insert(act->GetHandle());
}
- std::vector<HANDLE> inherited_handles(unique_handles.begin(),
unique_handles.end());
+ std::vector<HANDLE> inherited_handles(unique_handles.begin(),
+ unique_handles.end());
if (inherited_handles.empty())
return std::vector<HANDLE>{};
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 264b86016..107227d13 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -860,11 +860,11 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
debugserver_args.AppendArgument(llvm::formatv("--fd={0}", *comm_fd).str());
// Send "comm_fd" down to the inferior so it can use it to communicate back
// with this process.
- #ifdef _WIN32
+#ifdef _WIN32
int fd = _open_osfhandle((intptr_t)*comm_fd, NULL);
- #else
+#else
int fd = *commd_fd;
- #endif
+#endif
launch_info.AppendDuplicateFileAction(fd, fd);
} else {
llvm::StringRef url = std::get<llvm::StringRef>(comm);
@@ -891,11 +891,11 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
pipe_t write = socket_pipe.GetWritePipe();
debugserver_args.AppendArgument(llvm::StringRef("--pipe"));
debugserver_args.AppendArgument(llvm::to_string(write));
- #ifdef _WIN32
+#ifdef _WIN32
int write_fd = _open_osfhandle((intptr_t)*comm_fd, NULL);
- #else
+#else
int write_fd = *commd_fd;
- #endif
+#endif
launch_info.AppendDuplicateFileAction(write_fd, write_fd);
#endif
}
diff --git a/lldb/tools/lldb-server/lldb-platform.cpp
b/lldb/tools/lldb-server/lldb-platform.cpp
index 1493c149a..97cfa59af 100644
--- a/lldb/tools/lldb-server/lldb-platform.cpp
+++ b/lldb/tools/lldb-server/lldb-platform.cpp
@@ -326,11 +326,11 @@ static Status spawn_process(const char *progname, const
FileSpec &prog,
self_args.AppendArgument(llvm::StringRef("platform"));
self_args.AppendArgument(llvm::StringRef("--child-platform-fd"));
self_args.AppendArgument(llvm::to_string(shared_socket.GetSendableFD()));
- #ifdef _WIN32
+#ifdef _WIN32
int fd = _open_osfhandle((intptr_t)shared_socket.GetSendableFD(), NULL);
- #else
+#else
int fd = shared_socket.GetSendableFD();
- #endif
+#endif
launch_info.AppendDuplicateFileAction(fd, fd);
if (gdb_port) {
self_args.AppendArgument(llvm::StringRef("--gdbserver-port"));
diff --git a/lldb/unittests/Host/HostTest.cpp b/lldb/unittests/Host/HostTest.cpp
index 242998921..cff25996f 100644
--- a/lldb/unittests/Host/HostTest.cpp
+++ b/lldb/unittests/Host/HostTest.cpp
@@ -157,11 +157,11 @@ TEST(Host, LaunchProcessDuplicatesHandle) {
"--gtest_filter=Host.LaunchProcessDuplicatesHandle");
info.GetArguments().AppendArgument(
("--test-arg=" + llvm::Twine((uint64_t)pipe.GetWritePipe())).str());
- #ifdef _WIN32
+#ifdef _WIN32
int fd = _open_osfhandle((intptr_t)pipe.GetWritePipe(), NULL);
- #else
+#else
int fd = pipe.GetWritePipe();
- #endif
+#endif
info.AppendDuplicateFileAction(fd, fd);
info.SetMonitorProcessCallback(&ProcessLaunchInfo::NoOpMonitorCallback);
ASSERT_THAT_ERROR(Host::LaunchProcess(info).takeError(), llvm::Succeeded());
``````````
</details>
https://github.com/llvm/llvm-project/pull/179274
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits