================
@@ -438,6 +438,19 @@ Status Variable::GetValuesForVariableExpressionPath(
   return error;
 }
 
+bool Variable::IsThreadLocal() const {
+  ModuleSP module_sp(m_owner_scope->CalculateSymbolContextModule());
+  // Give the symbol vendor a chance to add to the unified section list.
+  module_sp->GetSymbolFile();
+  std::vector<uint32_t> symbol_indexes;
+  module_sp->GetSymtab()->FindAllSymbolsWithNameAndType(
+      ConstString(GetName()), lldb::SymbolType::eSymbolTypeAny, 
symbol_indexes);
+  if (symbol_indexes.empty())
+    return false;
+  Symbol *symbol = module_sp->GetSymtab()->SymbolAtIndex(symbol_indexes[0]);
+  return symbol->GetAddress().GetSection()->IsThreadSpecific();
+}
+
----------------
clayborg wrote:

This doesn't work for all architectures so this belongs in an OS ABI plug-in or 
something like that. We debug many different systems: linux, macOS, iOS, 
windows, Android etc, and the way variables are stored is an OS ABI thing.

https://github.com/llvm/llvm-project/pull/110822
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to