aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2025-02-28 15:58:29 +0000
committerGitHub <noreply@github.com>2025-02-28 15:58:29 +0000
commit09c64e56d4b79421ea3ccb3e8766d1056725874d (patch)
tree71214e3d13a548896f5654c4a0bf1ca90b9eedbd /llvm/tools/llvm-objdump/llvm-objdump.cpp
parent2639dea7d83cfd5c6bbca84b24d7c5bd599b2e8e (diff)
downloadllvm-09c64e56d4b79421ea3ccb3e8766d1056725874d.zip
llvm-09c64e56d4b79421ea3ccb3e8766d1056725874d.tar.gz
llvm-09c64e56d4b79421ea3ccb3e8766d1056725874d.tar.bz2
[lldb] Restore register state if PrepareTrivialCall fails (#129038)
Fixes #124269 PrepareTrivalCall always had the possibility of failing, but given that it only wrote to general purpose registers, if it did, you had bigger problems. When it failed, we did not mark the thread plan valid and when it was torn down we didn't try to restore the register state. This meant that if you tried to continue, the program was unlikely to work. When I added AArch64 GCS support, I needed to handle the situation where the GCS pointer points to unmapped memory and we fail to write the extra entry we need. So I added code to restore the gcspr_el0 register specifically if this happened, and ordered the operations so that we tried this first. In this change I've made the teardown of an invalid thread plan restore the register state if one was saved. It may be there isn't one if ConstructorSetup fails, but this is ok because that function does not modify anything. Now that we're doing that, I don't need the GCS specific code anymore, and all thread plans are protected from this in the rare event something does fail. Testing is done by the existing GCS test case that points the gcspr into unmapped memory which causes PrepareTrivialCall to fail. I tried adding a simulated test using a mock gdb server. This was not possible because they all use DynamicLoaderStatic which disables all JIT features.
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
0 files changed, 0 insertions, 0 deletions