I have a core dump and I want to get a Linux tid of a pthread in it using gdb. I have reached the point using this answer:
(gdb) p &this->m_thread->m_state->m_Thread
$29 = (pthread_t *) 0x7f05f84bde00
(gdb) p &((struct pthread *)(&this->m_thread->m_state->m_Thread))->tid
$28 = (pid_t *) 0x7f05f84be0d0
(gdb) p *&((struct pthread *)(&this->m_thread->m_state->m_Thread))->tid
$30 = 136478480
But the value does not look like LWP 2977, ... LWP 5110 that I can see when doing info threads
. What do I do wrong?