[Lldb-commits] [lldb] [lldb][RISCV] Implement access to TLS variables on RISC-V (PR #191410)

Sam Elliott via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 10 16:16:51 PDT 2026


================
@@ -915,8 +950,26 @@ DynamicLoaderPOSIXDYLD::GetThreadLocalData(const lldb::ModuleSP module_sp,
   if (tls_block == LLDB_INVALID_ADDRESS) {
     LLDB_LOGF(log, "GetThreadLocalData error: fail to read tls_block");
     return LLDB_INVALID_ADDRESS;
-  } else
-    return tls_block + tls_file_addr;
+  }
+
+  // DW_OP_GNU_push_tls_address gives us a value in tls_file_addr that can be
----------------
lenary wrote:

The docs for this that I could find were https://sourceware.org/elfutils/DwarfExtensions - "Translates offset to address in TLS area (NOT equivalent to DWARF4 DW_OP_form_tls_address which translates addresses directly)"

How you describe the latter, it doesn't quite sound like an offset, so is maybe the emitter producing wrong dwarf for some of these expressions?

https://github.com/llvm/llvm-project/pull/191410


More information about the lldb-commits mailing list