llvm / llvm/llvm-project

LLDB does not support Thread Local variables on Windows

Open
#196,288 1 comment 0 reactions 0 assignees View on GitHub
lldb platform:windows
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Originally reported as part of https://github.com/llvm/llvm-project/issues/196083.

```
(lldb) r
Process 23792 launched: 'C:\tls\tls-l22.exe' (x86_64)
Process 23792 stopped
* thread #1, stop reason = breakpoint 1.1
frame #0: 0x00007ff6b1241436 tls-l22.exe`main at tls.c:7:3
4
5 int main()
6 {
-> 7 tls1 = 101;
8 tls2 = 102;
9
10 return tls1 + tls2;
(lldb) p tls1

error: Couldn't materialize: couldn't get the value of variable tls1: no TLS data currently exists for this thread
error: errored out in DoExecute, couldn't PrepareToExecuteJITExpression
```
Following the code, Thread will ask the dynamic loader for the location of the TLS data. DynamicLoaderWindowsDYLD does not override DynamicLoader::GetThreadLocalData so it just returns an invalid address.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.