[Lldb-commits] [lldb] [llvm] [lldb][ARM] Support thread local variables on ARM Linux (PR #181315)
Igor Kudrin via lldb-commits
lldb-commits at lists.llvm.org
Thu Feb 19 21:48:11 PST 2026
igorkudrin wrote:
> > I've just realised that I forgot to specify a distinct offset for the new register.
>
> Sorry to bring this up so late but this reminds me we need tests for the register access. Please split this PR so that adding the new register is its own PR, and this is just the dyld parts.
I've created #182438; will update this PR when the other one is merged.
> My AArch64 TLS register commits for reference: [7e22921](https://github.com/llvm/llvm-project/commit/7e229217f4215b519b886e7881bae4da3742a7d2) [43ad521](https://github.com/llvm/llvm-project/commit/43ad521f2fa9a50e6b30425a3b9fb3025b42587a) [6239227](https://github.com/llvm/llvm-project/commit/6239227172cdc92f3bb72131333f50f83a6439cf)
Thanks for the references!
> You've implemented the register as read only, which is fine. So you don't need to test what happens with an expression, just check that a write from lldb fails. You can likely use the existing Arm core file and read whatever random value happens to be in there.
As far as I can see, `NT_ARM_TLS` notes are not generated for Arm32 binaries, so this feature will be missing for core files.
> Each needs a release note, I suggest:
>
> * On Arm Linux, the `tpidruro` register can now be read. Writing to this register is not supported.
> * Thread local variables are now supported on Arm Linux if the program being debugged is using glibc.
Thanks!
> And to be clear - you don't need to annotate the tests with any "only if glibc" stuff. We don't actively support running the test suite on Linux with anything else.
>
> My concern with other C libraries is what individual users see rather than people who build and test lldb. If those folks need musl support than as you say, they can work on that.
Such users will be able to read the TP register, but because `DynamicLoaderPOSIXDYLD::GetThreadLocalData()` will not get the valid metadata and return `LLDB_INVALID_ADDRESS`, thread local variables will still display the same "optimized out" message. At least, their debugging experience won't worsen.
https://github.com/llvm/llvm-project/pull/181315
More information about the lldb-commits
mailing list