[Lldb-commits] [lldb] [lldb][Mach-O] Fix load-command loops spinning on cmdsize = 0 (PR #205134)

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 23 00:22:36 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
----------------
jasonmolenda wrote:

This could just be a personal style thing, but I wonder if documenting that T must be a struct that starts with uint32_t cmd and uint32_t cmdsize fields might be helpful.  I'm more asking your thoughts than suggesting it strongly.  I was reading through this trying to see why this couldn't just be a void* cast to a struct lc_cmd but I think the template is fine, esp in the ObjectFileMachO case where there are several variations.

https://github.com/llvm/llvm-project/pull/205134


More information about the lldb-commits mailing list