Skip to content
Unverified Commit e8ea4760 authored by jeffreytan81's avatar jeffreytan81 Committed by GitHub
Browse files

[lldb] Implement thread local storage for linux (#67470)

This patch implements the thread local storage support for linux
(https://github.com/llvm/llvm-project/issues/28766).

TLS feature is originally only implemented for Mac. With my previous
patch to enable `fs_base` register for Linux
(https://reviews.llvm.org/D155256

), now it is feasible to implement this
feature for Linux.

The major changes are:
* Track the main module's link address during launch
* Fetch thread pointer from `fs_base` register
* Create register alias for thread pointer
* Read pthread metadata from target memory instead of process so that it
works for coredump

With the patch the failing test is passing now. Note: I am only enabling
this test for Mac and Linux because I do not have machine to test for
FreeBSD/NetBSD.

---------

Co-authored-by: default avatarjeffreytan81 <jeffreytan@fb.com>
parent 339fc5e6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment