LLDB does not acknowledge TLS variables.
Repro (assumes you are on a glibc system):
lldb /bin/sh
(lldb) b main
(lldb) run
(lldb) p &errno
˄
╰─ error: use of undeclared identifier 'errno'
whereas in gdb:
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:
|
if (symbol_type != eSymbolTypeUndefined) { |
. The SST_TLS type is not handled:
|
STT_TLS = 6, // Thread local data object |
LLDB does not acknowledge TLS variables.
Repro (assumes you are on a glibc system):
whereas in gdb:
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:
llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
Line 2207 in 9dde0a8
llvm-project/llvm/include/llvm/BinaryFormat/ELF.h
Line 1422 in 9dde0a8