简体   繁体   中英

lldb cannot print TLS variable

I've decided to use TLS variables on my C project to define some variables that should be valid throughout thread scope.

Here's my declaration : static __thread char log_username[100];

however, for some reason the lldb debugger fail to show them for the following reason :

(lldb) print log_username[2]
error: Couldn't materialize: couldn't get the value of variable log_username: 
No TLS data currently exists for this thread.
Errored out in Execute, couldn't PrepareToExecuteJITExpression

The debugger states that TLS data is currently not available, but if I use simple printf, it works.

Any idea how to resolve this, or just treat it as debugger limitation that I can live with ...

lldb 目前不支持 OS X 上的线程本地存储变量(不确定 Linux。)您可以通过为 TLS 变量创建访问器函数并在选择适当的线程后调用它们来解决此问题。

对于在 Linux 上调试 OpenMP 块的我来说,只有在从 GCC 更改为 Clang 并安装 LLVM 库后,我才能使用 LLDB 打印 TLV

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM