Skip to content

[LLDB] LLDB does not acknowledge TLS variables #178953

@k4lizen

Description

@k4lizen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions