binutils-gdb/gdb/gdbserver/acinclude.m4
Daniel Jacobowitz dae5f5cf4b * 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.
2006-10-17 16:02:27 +00:00

64 lines
1.6 KiB
Plaintext

dnl gdb/gdbserver/configure.in uses BFD_HAVE_SYS_PROCFS_TYPE.
sinclude(../../bfd/bfd.m4)
AC_DEFUN([SRV_CHECK_THREAD_DB],
[AC_CACHE_CHECK([for libthread_db],[srv_cv_thread_db],
[old_LIBS="$LIBS"
LIBS="$LIBS -lthread_db"
AC_TRY_LINK(
[void ps_pglobal_lookup() {}
void ps_pdread() {}
void ps_pdwrite() {}
void ps_lgetregs() {}
void ps_lsetregs() {}
void ps_lgetfpregs() {}
void ps_lsetfpregs() {}
void ps_get_thread_area() {}
void ps_getpid() {}],
[td_ta_new();],
[srv_cv_thread_db="-lthread_db"],
[srv_cv_thread_db=no
if test "$prefix" = "/usr" || test "$prefix" = "NONE"; then
thread_db="/lib/libthread_db.so.1"
else
thread_db='$prefix/lib/libthread_db.so.1'
fi
LIBS="$old_LIBS `eval echo "$thread_db"`"
AC_TRY_LINK(
[void ps_pglobal_lookup() {}
void ps_pdread() {}
void ps_pdwrite() {}
void ps_lgetregs() {}
void ps_lsetregs() {}
void ps_lgetfpregs() {}
void ps_lsetfpregs() {}
void ps_get_thread_area() {}
void ps_getpid() {}],
[td_ta_new();],
[srv_cv_thread_db="$thread_db"],
[srv_cv_thread_db=no])
])
LIBS="$old_LIBS"
])])
AC_DEFUN([SRV_CHECK_TLS_GET_ADDR],
[AC_CACHE_CHECK([for thread_db_tls_get_addr],[srv_cv_tls_get_addr],
[old_LIBS="$LIBS"
LIBS="$LIBS $srv_cv_thread_db"
AC_TRY_LINK(
[void ps_pglobal_lookup() {}
void ps_pdread() {}
void ps_pdwrite() {}
void ps_lgetregs() {}
void ps_lsetregs() {}
void ps_lgetfpregs() {}
void ps_lsetfpregs() {}
void ps_get_thread_area() {}
void ps_getpid() {}],
[td_thr_tls_get_addr();],
[srv_cv_tls_get_addr=yes],
[srv_cv_tls_get_addr=no])
LIBS="$old_LIBS"
])])