[lldb-dev] What is the difference between an Arch and a Triple

Jim Ingham via lldb-dev lldb-dev at lists.llvm.org
Thu Jan 21 12:04:17 PST 2021


We have two API's:

SBDebugger.CreateTargetWithFileAndTargetTriple
SBDebugger.CreateTargetWithFileAndArch

Both take a path and a string.  Currently, their implementations are almost identical, the major difference being that the first one ignores the error from target creation, but I don't think that part is on purpose.

I can't find anywhere where we say what the difference between a "TargetTriple" and an "Arch" is.  I think the difference is that for an Arch you are allowed to pass lldb.LLDB_ARCH_DEFAULT as well as a target triple.  At least the example at the top of SBDebugger.i indicates this should work.  Unsurprisingly, since the two implementations are functionally the same, the call we suggest in SBDebugger.i using LLDB_ARCH_DEFAULT doesn't in fact work.  

There's also a FindTargetByFileAndArch that also takes lldb.LLDB_ARCH_DEFAULT, but it actually does the work to translate the string using the current Platform, and that does work.

The SBDebugger API is easy to fix, but I wanted to also put in something saying what the difference was except I'm not sure what to say.

Jim



More information about the lldb-dev mailing list