aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
diff options
context:
space:
mode:
authorjeffreytan81 <jeffreytan@meta.com>2023-09-27 09:14:40 -0700
committerGitHub <noreply@github.com>2023-09-27 09:14:40 -0700
commite8ea47602bdb74a88c707d289fc241f7670e1483 (patch)
tree5ed7eef0294a5882f69abaf3b10fac0bdcc1f5d4 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
parent339fc5e6b013dfdb185f1f1e9494076bd9d2a3cd (diff)
downloadllvm-e8ea47602bdb74a88c707d289fc241f7670e1483.zip
llvm-e8ea47602bdb74a88c707d289fc241f7670e1483.tar.gz
llvm-e8ea47602bdb74a88c707d289fc241f7670e1483.tar.bz2
[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: jeffreytan81 <jeffreytan@fb.com>
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 65c7a0f..23c2f18 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -595,6 +595,8 @@ static llvm::StringRef GetKindGenericOrEmpty(const RegisterInfo &reg_info) {
return "arg7";
case LLDB_REGNUM_GENERIC_ARG8:
return "arg8";
+ case LLDB_REGNUM_GENERIC_TP:
+ return "tp";
default:
return "";
}