[Lldb-commits] [lldb] [lldb][Mach-O] Fix load-command loops spinning on cmdsize = 0 (PR #205134)
Yao Qi via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 23 08:57:53 PDT 2026
================
@@ -21,6 +21,24 @@ using namespace lldb;
using namespace lldb_private;
using namespace llvm::MachO;
+/// Read a Mach-O load-command header (cmd + cmdsize) from \p data at
----------------
qiyao wrote:
I had three versions of this PRs. The one I posted here is v3, and v2 is like what you said, cast to `load_command` in the method, and the method has no template. I feel that the template one is better than the cast one, so I use v3 to create PR.
I update this PR to add some compile-time check in `ReadMachOCommand<T>` to guarrentee that T must start with `uint32_t cmd` followed by `uint32_t cmdsize`.
https://github.com/llvm/llvm-project/pull/205134
More information about the lldb-commits
mailing list