[Lldb-commits] [lldb] [lldb] Fix `ObjectFileMachO` object format when missing version load commands (PR #144177)

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 17 17:47:40 PDT 2025


jasonmolenda wrote:

> Hi @jasonmolenda,
> 
> > I don't want to see -macho in a triple that we're creating for any of these modules; this is going to break things down the line with firmware environments, I'm sure of it. It's also ugly.
> 
> For context, could you elaborate where/why are we relying on the triple string in production? E.g. I don't understand the "firmware environments" part.

We've found that changes to triples have far reaching impact and fallout, over the years, and most of us who have made these changes have learned to be very wary of making them unless necessary because of the fragility in all the different environments we support.  Our tests are not very comprehensive for non-user land process debugging -- kernel debugging, firmware debugging, bare board debugging.

>From the SB API layer, the only thing we vend are triple strings, there is no SBArchSpec object that encompasses the separate features in the Triple.


> Is there any case at all where we want the "object format" component to be displayed in the triple string? If not, can we just remove the object format component from the triple string once and for all? (no matter whether the object format is set explicitly or get from `getDefaultFormat()`)


Personally, no, I don't see why you'd want to include the object file format in the triple string.  But I don't know why that behavior was added to llvm's Triple class in the beginning so there may be a use case where it is important.


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


More information about the lldb-commits mailing list