[Lldb-commits] [lldb] [lldb][Mach-O] Fix load-command loops spinning on cmdsize = 0 (PR #205134)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 23 08:58:09 PDT 2026
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 cpp -- lldb/source/Plugins/ObjectContainer/Mach-O-Fileset/ObjectContainerMachOFileset.cpp lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp lldb/unittests/ObjectContainer/ObjectContainerUniversalMachOTest.cpp lldb/unittests/ObjectFile/MachO/TestObjectFileMachO.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/source/Plugins/ObjectContainer/Mach-O-Fileset/ObjectContainerMachOFileset.cpp b/lldb/source/Plugins/ObjectContainer/Mach-O-Fileset/ObjectContainerMachOFileset.cpp
index 82947ecaa..bc60c00e6 100644
--- a/lldb/source/Plugins/ObjectContainer/Mach-O-Fileset/ObjectContainerMachOFileset.cpp
+++ b/lldb/source/Plugins/ObjectContainer/Mach-O-Fileset/ObjectContainerMachOFileset.cpp
@@ -32,8 +32,7 @@ using namespace llvm::MachO;
template <typename T>
static bool ReadMachOCommand(DataExtractor &data, lldb::offset_t &offset,
T &cmd) {
- static_assert(offsetof(T, cmd) == 0,
- "T::cmd must be the first field");
+ static_assert(offsetof(T, cmd) == 0, "T::cmd must be the first field");
static_assert(offsetof(T, cmdsize) == sizeof(uint32_t),
"T::cmdsize must immediately follow T::cmd");
static_assert(std::is_same<decltype(T::cmd), uint32_t>::value,
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 565669de7..391ffe240 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -150,8 +150,7 @@ LLDB_PLUGIN_DEFINE(ObjectFileMachO)
template <typename T>
static bool ReadMachOCommand(const DataExtractor &data, lldb::offset_t &offset,
T &cmd) {
- static_assert(offsetof(T, cmd) == 0,
- "T::cmd must be the first field");
+ static_assert(offsetof(T, cmd) == 0, "T::cmd must be the first field");
static_assert(offsetof(T, cmdsize) == sizeof(uint32_t),
"T::cmdsize must immediately follow T::cmd");
static_assert(std::is_same<decltype(T::cmd), uint32_t>::value,
``````````
</details>
https://github.com/llvm/llvm-project/pull/205134
More information about the lldb-commits
mailing list