Hi All,
I figured an issue in the _expression_ parser of LLDB.
Firstly, I'm not sure if LLDB uses its own parser or if it's based somehow on LLVM. Anyway, here is the problem:
LLDB prints the following result for the given _expression_: (lldb) print ((uint8_t)(0) - 0xC2) < 0x32 (_Bool) $2 = true
If my understandings of the C99 integer promotion, value preserving and sign preserving rules are correct, the result should be false however. The rationale and the rules for the above _expression_ do appear complex, however LLVM and GCC both agree on me ;)
Here is code that corresponds to the _expression_ above:
uint8_t c = 0; bool result = (c - 0xC2) < 0x32;
LLVM and GCC will evaluate this to false.
Regards Andreas |