int thread_db_get_tls_address (struct thread_info *thread, CORE_ADDR offset, CORE_ADDR load_module, CORE_ADDR *address) { #if HAVE_TD_THR_TLS_GET_ADDR psaddr_t addr; td_err_e err; struct process_info *process; process = get_thread_process (thread); if (!process->thread_known) return TD_NOTHR; err = td_thr_tls_get_addr (&process->th, (psaddr_t) load_module, offset, &addr); if (err == TD_OK) { *address = (CORE_ADDR) addr; return 0; } else return err; #else return -1; #endif }
int thread_db_get_tls_address(int64_t thread, uint64_t lm, uint64_t offset, uintptr_t *tlsaddr) { td_err_e err; td_thrhandle_t th; psaddr_t addr = 0; if (_target.thread_agent == NULL) return RET_ERR; err = td_ta_map_id2thr(_target.thread_agent, thread, &th); if (err) return RET_ERR; err = td_thr_tls_get_addr(&th, lm, offset, &addr); if (err) return RET_ERR; *tlsaddr = (uintptr_t) addr; return RET_OK; }