[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:50:21 PDT 2025


jasonmolenda wrote:

> One idea is to add a new string method on the llvm::Triple class:
> 
> ```
>   const std::string strNoObjectFormat() const;
> ```
> 
> And this would check if the object format is in the string in `llvm::Triple::Data` and if so strip it and return it, else return the `llvm::Triple::Data` as is. Then we switch LLDB to use the `llvm::Triple::strNoObjectFormat()` function everywhere.

A `Triple::setObjectFormatNoStringUpdate` or whatever would be another way to approach this.  Instead of stripping the object file name out of the triple string when returning it, have a way to specify/change the object format without any update to the triple string.   We've been using Triples with ObjectFile set to ELF for ever and never had that show up in the triple string, I don't worry about it leaking in there unintentionally.

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


More information about the lldb-commits mailing list