[Lldb-commits] [PATCH] D19604: Allow ObjectFilePECOFF to initialize with ARM binaries.

Renato Golin via lldb-commits lldb-commits at lists.llvm.org
Wed May 4 03:27:23 PDT 2016

rengolin added a comment.

In http://reviews.llvm.org/D19604#420681, @jasonmolenda wrote:

> fwiw, there are ARM cores that only support thumb - the Cortex M series.

And they're still "armv7". :)

Remember, "armv7" is *not* the same as ARMv7A+NEON. If the only thing you have is "armv7" or even "armv7-a", you *cannot* assume NEON is present.

> The importance of the triple used will come in to play when you try to evaluate an expression on the device -- lldb will call into llvm to parse/jit the expression into machine code for the device.  For instance, if "arm-windows" translates to a minimum arm target, llvm may not think it has any fp/NEON instructions.

This is worrying. LLDB should *not* rely only on the triple, but all architectural options (mcpu/mtune/march/mfpu/mfloat-abi).

Without it, it can infer very little, and obscure bugs will crop up if the meaning of the triple changes slightly in the future.

> As for lldb disassembling as arm/thumb (or instruction emulation for unwinding), today it doesn't use the CPSR/XPSR T bit to tell if the current instruction is thumb or not, it depends on annotations in the symbol file to do this correctly.  I don't think it uses the 0th bit of saved pc values up the stack to tell this either -- it is a pretty fixed model of depending on the symbols to indicate whether they're arm or thumb.

These are the easy cases. You still need both disassemblers to areas where you have no idea what it is (system binaries, etc.), where you have to try both and see which one has the least number of errors. :)



More information about the lldb-commits mailing list