[LLDB] LLDB does not acknowledge TLS variables (when DWARF isn't present)
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
LLDB does not acknowledge TLS variables.
Repro (assumes you are on a glibc system):
```bash
lldb /bin/sh
(lldb) b main
(lldb) run
(lldb) p &errno
˄
╰─ error: use of undeclared identifier 'errno'
```
whereas in gdb:
```bash
gdb /bin/sh
gdb> b main
gdb> run
gdb> p &errno
$1 = 0
```
It's defined here:
https://elixir.bootlin.com/glibc/glibc-2.41/source/csu/errno.c#L32
It's a dynamic/exported symbol so it's always available even on a stripped glibc.
In LLDB ELF parsing:
https://github.com/llvm/llvm-project/blob/9dde0a803bbc761cb6a6e785412a00652053861e/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp#L2207 . The SST_TLS type is not handled: https://github.com/llvm/llvm-project/blob/9dde0a803bbc761cb6a6e785412a00652053861e/llvm/include/llvm/BinaryFormat/ELF.h#L1422
Contributor guide
Assessment
This issue has not been assessed yet.