* acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.

* configure.ac: Use it.  Define HAVE_TD_THR_TLS_GET_ADDR.
	* config.in, configure: Regenerated.
	* inferiors.c (gdb_id_to_thread): New function.
	(gdb_id_to_thread_id): Use it.
	* linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
	* linux-low.h (struct process_info): Add th member.
	(thread_db_get_tls_address): New prototype.
	* remote-utils.c (decode_address): Make non-static.
	* server.c (handle_query): Handle qGetTLSAddr.
	* server.h (gdb_id_to_thread, decode_address): New prototypes.
	* target.h (struct target_ops): Add get_tls_address.
	* thread-db.c (maybe_attach_thread): Save the thread handle.
	(thread_db_get_tls_address): New.
This commit is contained in:
Daniel Jacobowitz
2006-10-17 16:02:27 +00:00
parent 5bd2f6e2a6
commit dae5f5cf4b
13 changed files with 2164 additions and 2673 deletions

View File

@@ -18,6 +18,10 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#ifdef HAVE_THREAD_DB_H
#include <thread_db.h>
#endif
#ifdef HAVE_LINUX_REGSETS
typedef void (*regset_fill_func) (void *);
typedef void (*regset_store_func) (const void *);
@@ -124,6 +128,11 @@ struct process_info
and then processed and cleared in linux_resume_one_process. */
struct thread_resume *resume;
#ifdef HAVE_THREAD_DB_H
/* The thread handle, used for e.g. TLS access. */
td_thrhandle_t th;
#endif
};
extern struct inferior_list all_processes;
@@ -131,3 +140,5 @@ extern struct inferior_list all_processes;
void linux_attach_lwp (unsigned long pid, unsigned long tid);
int thread_db_init (void);
int thread_db_get_tls_address (struct thread_info *thread, CORE_ADDR offset,
CORE_ADDR load_module, CORE_ADDR *address);