Given the following source code:
namespace EventThreadLocal {
static thread_local std::unique_ptr<std::vector<EventInfo>> Stack;
static const EventInfo* Top()
{
auto stack = Stack.get();
if (!stack)
return nullptr;
if (stack->empty())
return nullptr;
return &(stack->back());
}
}
How can I inspect the contents of the static thread_local variable Stack on a heap dump?
My understanding is that the command !tls displays the thread local storage slots, but how can I know the appropriate slot index used by this variable?