aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2025-08-13 09:48:29 +0100
committerGitHub <noreply@github.com>2025-08-13 09:48:29 +0100
commitb563b274b8a8b00dadb63e67d648421c110449ff (patch)
tree5f0572d9225e51cb8179f187648439e8d7a12e85 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parentdc41571cd8af5a4de87412c64666899ec3f2b971 (diff)
downloadllvm-b563b274b8a8b00dadb63e67d648421c110449ff.zip
llvm-b563b274b8a8b00dadb63e67d648421c110449ff.tar.gz
llvm-b563b274b8a8b00dadb63e67d648421c110449ff.tar.bz2
[lldb] Convert registers values into target endian for expressions (#148836)
Relates to https://github.com/llvm/llvm-project/issues/135707 Where it was reported that reading the PC using "register read" had different results to an expression "$pc". This was happening because registers are treated in lldb as pure "values" that don't really have an endian. We have to store them somewhere on the host of course, so the endian becomes host endian. When you want to use a register as a value in an expression you're pretending that it's a variable in memory. In target memory. Therefore we must convert the register value to that endian before use. The test I have added is based on the one used for XML register flags. Where I fake an AArch64 little endian and an s390x big endian target. I set up the data in such a way the pc value should print the same for both, either with register read or an expression. I considered just adding a live process test that checks the two are the same but with on one doing cross endian testing, I doubt it would have ever caught this bug. Simulating this means most of the time, little endian hosts will test little to little and little to big. In the minority of cases with a big endian host, they'll check the reverse. Covering all the combinations.
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
0 files changed, 0 insertions, 0 deletions