#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.10
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated automatically using autoconf version 2.8
+# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.10"
+ echo "configure generated by autoconf version 2.8"
exit 0 ;;
-with-* | --with-*)
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
char $ac_func();
int main() { return 0; }
; return 0; }
EOF
-if { (eval echo configure:1463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+if { (eval echo configure:1461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1491 "configure"
+#line 1489 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() { return 0; }
gregset_t *gregsetp = 0
; return 0; }
EOF
-if { (eval echo configure:1499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+if { (eval echo configure:1497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_gregset_t=yes
else
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1523 "configure"
+#line 1521 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() { return 0; }
fpregset_t *fpregsetp = 0
; return 0; }
EOF
-if { (eval echo configure:1531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+if { (eval echo configure:1529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_fpregset_t=yes
else
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1556 "configure"
+#line 1554 "configure"
#include "confdefs.h"
int main() { return 0; }
long double foo;
; return 0; }
EOF
-if { (eval echo configure:1564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_long_double=yes
else
gdb_cv_printf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 1592 "configure"
+#line 1590 "configure"
#include "confdefs.h"
int main () {
return (strncmp ("3.14159", buf, 7));
}
EOF
-{ (eval echo configure:1602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
+{ (eval echo configure:1600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
if test -s conftest && (./conftest; exit) 2>/dev/null; then
gdb_cv_printf_has_long_double=yes
else
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1627 "configure"
+#line 1625 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
char $ac_func();
int main() { return 0; }
; return 0; }
EOF
-if { (eval echo configure:1651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+if { (eval echo configure:1647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
ac_cv_func_mmap=no
else
cat > conftest.$ac_ext <<EOF
-#line 1681 "configure"
+#line 1677 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test. */
}
EOF
-{ (eval echo configure:1750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
+{ (eval echo configure:1746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
if test -s conftest && (./conftest; exit) 2>/dev/null; then
ac_cv_func_mmap=yes
else
-echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
-if test -f /usr/lib/libthread_db.so.1 ; then
- echo "$ac_t""yes" 1>&6
- LIBS="$LIBS /usr/lib/libthread_db.so.1"
- THREAD_DB_OBS=sol-thread.o
- cat >> confdefs.h <<\EOF
+if test ${host} = ${target} ; then
+ echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
+ if test -f /usr/lib/libthread_db.so.1 ; then
+ echo "$ac_t""yes" 1>&6
+ THREAD_DB_OBS=sol-thread.o
+ cat >> confdefs.h <<\EOF
#define HAVE_THREAD_DB_LIB 1
EOF
-else
- echo "$ac_t""no" 1>&6
+ CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Xlinker -export-dynamic"
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+
+
fi
-
ENABLE_CFLAGS=
ENABLE_CLIBS=
ENABLE_OBS=
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 1933 "configure"
+#line 1932 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2005 "configure"
+#line 2004 "configure"
#include "confdefs.h"
int main() { return 0; }
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:2013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+if { (eval echo configure:2012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for -lICE""... $ac_c" 1>&6
-ac_lib_var=`echo ICE'_'IceConnectionNumber | tr './+\055' '__p_'`
+ac_lib_var=`echo ICE_IceConnectionNumber | tr '.-/+' '___p'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lICE $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2134 "configure"
+#line 2133 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char IceConnectionNumber();
int main() { return 0; }
int t() {
IceConnectionNumber()
; return 0; }
EOF
-if { (eval echo configure:2146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+if { (eval echo configure:2141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for -ldnet""... $ac_c" 1>&6
-ac_lib_var=`echo dnet'_'dnet_ntoa | tr './+\055' '__p_'`
+ac_lib_var=`echo dnet_dnet_ntoa | tr '.-/+' '___p'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2182 "configure"
+#line 2177 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dnet_ntoa();
int main() { return 0; }
int t() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:2194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+if { (eval echo configure:2185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for -ldnet_stub""... $ac_c" 1>&6
-ac_lib_var=`echo dnet_stub'_'dnet_ntoa | tr './+\055' '__p_'`
+ac_lib_var=`echo dnet_stub_dnet_ntoa | tr '.-/+' '___p'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2221 "configure"
+#line 2212 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dnet_ntoa();
int main() { return 0; }
int t() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:2233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+if { (eval echo configure:2220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# Not sure which flavor of 386 UNIX this is, but it seems harmless to
# check for it.
echo $ac_n "checking for -lnsl""... $ac_c" 1>&6
-ac_lib_var=`echo nsl'_'t_accept | tr './+\055' '__p_'`
+ac_lib_var=`echo nsl_t_accept | tr '.-/+' '___p'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2265 "configure"
+#line 2252 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char t_accept();
int main() { return 0; }
int t() {
t_accept()
; return 0; }
EOF
-if { (eval echo configure:2277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+if { (eval echo configure:2260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# But -lsocket is broken on IRIX, according to simon@lia.di.epfl.ch.
if test "`(uname) 2>/dev/null`" != IRIX; then
echo $ac_n "checking for -lsocket""... $ac_c" 1>&6
-ac_lib_var=`echo socket'_'socket | tr './+\055' '__p_'`
+ac_lib_var=`echo socket_socket | tr '.-/+' '___p'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2308 "configure"
+#line 2291 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char socket();
int main() { return 0; }
int t() {
socket()
; return 0; }
EOF
-if { (eval echo configure:2320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+if { (eval echo configure:2299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2417 "configure"
+#line 2396 "configure"
#include "confdefs.h"
#include <tclInt.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
else
cat > conftest.$ac_ext <<EOF
-#line 2475 "configure"
+#line 2454 "configure"
#include "confdefs.h"
#include <stdio.h>
return 0;
}
EOF
-{ (eval echo configure:2490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
+{ (eval echo configure:2469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
if test -s conftest && (./conftest; exit) 2>/dev/null; then
tclmajor=`cat tclmajor`
tclminor=`cat tclminor`
ac_cv_c_tclib="-l$installedtcllibroot"
else
cat > conftest.$ac_ext <<EOF
-#line 2635 "configure"
+#line 2614 "configure"
#include "confdefs.h"
Tcl_AppInit()
{ exit(0); }
EOF
-{ (eval echo configure:2641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
+{ (eval echo configure:2620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
if test -s conftest && (./conftest; exit) 2>/dev/null; then
ac_cv_c_tcllib="-l$installedtcllibroot"
else
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2751 "configure"
+#line 2730 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2735: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
else
cat > conftest.$ac_ext <<EOF
-#line 2816 "configure"
+#line 2795 "configure"
#include "confdefs.h"
#include <stdio.h>
return 0;
}
EOF
-{ (eval echo configure:2831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
+{ (eval echo configure:2810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
if test -s conftest && (./conftest; exit) 2>/dev/null; then
tkmajor=`cat tkmajor`
tkminor=`cat tkminor`
ac_cv_c_tklib="-l$installedtklibroot"
else
cat > conftest.$ac_ext <<EOF
-#line 2997 "configure"
+#line 2976 "configure"
#include "confdefs.h"
Tcl_AppInit()
{ exit(0); }
EOF
-{ (eval echo configure:3003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
+{ (eval echo configure:2982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
if test -s conftest && (./conftest; exit) 2>/dev/null; then
ac_cv_c_tklib="-l$installedtklibroot"
else
# beyond us.
if test $tclmajor -ge 7 -a $tclminor -ge 5 ; then
echo $ac_n "checking for -ldl""... $ac_c" 1>&6
-ac_lib_var=`echo dl'_'main | tr './+\055' '__p_'`
+ac_lib_var=`echo dl_main | tr '.-/+' '___p'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3044 "configure"
+#line 3023 "configure"
#include "confdefs.h"
int main() { return 0; }
main()
; return 0; }
EOF
-if { (eval echo configure:3052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+if { (eval echo configure:3031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for -ldld""... $ac_c" 1>&6
-ac_lib_var=`echo dld'_'main | tr './+\055' '__p_'`
+ac_lib_var=`echo dld_main | tr '.-/+' '___p'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3082 "configure"
+#line 3061 "configure"
#include "confdefs.h"
int main() { return 0; }
main()
; return 0; }
EOF
-if { (eval echo configure:3090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+if { (eval echo configure:3069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.10"
+ echo "$CONFIG_STATUS generated by autoconf version 2.8"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
s%@target_vendor@%$target_vendor%g
s%@target_os@%$target_os%g
s%@THREAD_DB_OBS@%$THREAD_DB_OBS%g
+s%@CONFIG_LDFLAGS@%$CONFIG_LDFLAGS%g
s%@X_CFLAGS@%$X_CFLAGS%g
s%@X_PRE_LIBS@%$X_PRE_LIBS%g
s%@X_LIBS@%$X_LIBS%g
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
echo "$ac_file is unchanged"
rm -f conftest.h
else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- fi
rm -f $ac_file
mv conftest.h $ac_file
fi
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
+#include <dlfcn.h>
extern struct target_ops sol_thread_ops; /* Forward declaration */
#define GET_THREAD(THREAD_ID) (((THREAD_ID) >> 16) & 0x7fff)
#define BUILD_LWP(LWP_ID, PID) ((LWP_ID) << 16 | (PID))
#define BUILD_THREAD(THREAD_ID, PID) (THREAD_FLAG | BUILD_LWP (THREAD_ID, PID))
+
+/* Pointers to routines from lithread_db resolved by dlopen() */
+
+static void
+ (*p_td_log) (const int on_off);
+static td_err_e
+ (*p_td_ta_new) (const struct ps_prochandle *ph_p, td_thragent_t **ta_pp);
+static td_err_e
+ (*p_td_ta_delete) (td_thragent_t *ta_p);
+static td_err_e
+ (*p_td_init) (void);
+static td_err_e
+ (*p_td_ta_get_ph) (const td_thragent_t *ta_p, struct ps_prochandle **ph_pp);
+static td_err_e
+ (*p_td_ta_get_nthreads) (const td_thragent_t *ta_p, int *nthread_p);
+static td_err_e
+ (*p_td_ta_tsd_iter) (const td_thragent_t *ta_p, td_key_iter_f *cb, void *cbdata_p);
+static td_err_e
+ (*p_td_ta_thr_iter) (const td_thragent_t *ta_p, td_thr_iter_f *cb, void *cbdata_p, td_thr_state_e state,
+ int ti_pri, sigset_t *ti_sigmask_p, unsigned ti_user_flags);
+static td_err_e
+ (*p_td_thr_validate) (const td_thrhandle_t *th_p);
+static td_err_e
+ (*p_td_thr_tsd) (const td_thrhandle_t *th_p, const thread_key_t key, void **data_pp);
+static td_err_e
+ (*p_td_thr_get_info) (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p);
+static td_err_e
+ (*p_td_thr_getfpregs) (const td_thrhandle_t *th_p, prfpregset_t *fpregset);
+static td_err_e
+ (*p_td_thr_getxregsize) (const td_thrhandle_t *th_p, int *xregsize);
+static td_err_e
+ (*p_td_thr_getxregs) (const td_thrhandle_t *th_p, const caddr_t xregset);
+static td_err_e
+ (*p_td_thr_sigsetmask) (const td_thrhandle_t *th_p, const sigset_t ti_sigmask);
+static td_err_e
+ (*p_td_thr_setprio) (const td_thrhandle_t *th_p, const int ti_pri);
+static td_err_e
+ (*p_td_thr_setsigpending) (const td_thrhandle_t *th_p, const uchar_t ti_pending_flag, const sigset_t ti_pending);
+static td_err_e
+ (*p_td_thr_setfpregs) (const td_thrhandle_t *th_p, const prfpregset_t *fpregset);
+static td_err_e
+ (*p_td_thr_setxregs) (const td_thrhandle_t *th_p, const caddr_t xregset);
+static td_err_e
+ (*p_td_ta_map_id2thr) (const td_thragent_t *ta_p, thread_t tid, td_thrhandle_t *th_p);
+static td_err_e
+ (*p_td_ta_map_lwp2thr) (const td_thragent_t *ta_p, lwpid_t lwpid, td_thrhandle_t *th_p);
+static td_err_e
+ (*p_td_thr_getgregs) (const td_thrhandle_t *th_p, prgregset_t regset);
+static td_err_e
+ (*p_td_thr_setgregs) (const td_thrhandle_t *th_p, const prgregset_t regset);
\f
/*
pid = PIDGET (thread_id);
thread_id = GET_THREAD(thread_id);
- val = td_ta_map_id2thr (main_ta, thread_id, &th);
+ val = p_td_ta_map_id2thr (main_ta, thread_id, &th);
if (val != TD_OK)
error ("thread_to_lwp: td_ta_map_id2thr %s", td_err_string (val));
- val = td_thr_get_info (&th, &ti);
+ val = p_td_thr_get_info (&th, &ti);
if (val != TD_OK)
error ("thread_to_lwp: td_thr_get_info: %s", td_err_string (val));
pid = PIDGET (lwp);
lwp = GET_LWP (lwp);
- val = td_ta_map_lwp2thr (main_ta, lwp, &th);
+ val = p_td_ta_map_lwp2thr (main_ta, lwp, &th);
if (val != TD_OK)
error ("lwp_to_thread: td_thr_get_info: %s.", td_err_string (val));
- val = td_thr_get_info (&th, &ti);
+ val = p_td_thr_get_info (&th, &ti);
if (val != TD_OK)
error ("lwp_to_thread: td_thr_get_info: %s.", td_err_string (val));
if (thread == 0)
error ("sol_thread_fetch_registers: thread == 0");
- val = td_ta_map_id2thr (main_ta, thread, &thandle);
+ val = p_td_ta_map_id2thr (main_ta, thread, &thandle);
if (val != TD_OK)
error ("sol_thread_fetch_registers: td_ta_map_id2thr: %s",
td_err_string (val));
/* Get the integer regs */
- val = td_thr_getgregs (&thandle, gregset);
+ val = p_td_thr_getgregs (&thandle, gregset);
if (val != TD_OK
&& val != TD_PARTIALREG)
error ("sol_thread_fetch_registers: td_thr_getgregs %s",
/* And, now the fp regs */
- val = td_thr_getfpregs (&thandle, &fpregset);
+ val = p_td_thr_getfpregs (&thandle, &fpregset);
if (val != TD_OK
&& val != TD_NOFPREGS)
error ("sol_thread_fetch_registers: td_thr_getfpregs %s",
thread = GET_THREAD (inferior_pid);
- val = td_ta_map_id2thr (main_ta, thread, &thandle);
+ val = p_td_ta_map_id2thr (main_ta, thread, &thandle);
if (val != TD_OK)
error ("sol_thread_store_registers: td_ta_map_id2thr %s",
td_err_string (val));
if (regno != -1)
{ /* Not writing all the regs */
- val = td_thr_getgregs (&thandle, regset);
+ val = p_td_thr_getgregs (&thandle, regset);
if (val != TD_OK)
error ("sol_thread_store_registers: td_thr_getgregs %s",
td_err_string (val));
- val = td_thr_getfpregs (&thandle, &fpregset);
+ val = p_td_thr_getfpregs (&thandle, &fpregset);
if (val != TD_OK)
error ("sol_thread_store_registers: td_thr_getfpregs %s",
td_err_string (val));
fill_gregset (regset, regno);
fill_fpregset (fpregset, regno);
- val = td_thr_setgregs (&thandle, regset);
+ val = p_td_thr_setgregs (&thandle, regset);
if (val != TD_OK)
error ("sol_thread_store_registers: td_thr_setgregs %s",
td_err_string (val));
- val = td_thr_setfpregs (&thandle, &fpregset);
+ val = p_td_thr_setfpregs (&thandle, &fpregset);
if (val != TD_OK)
error ("sol_thread_store_registers: td_thr_setfpregs %s",
td_err_string (val));
the shared libraries are located because it needs information from the
user's thread library. */
- val = td_init ();
+ val = p_td_init ();
if (val != TD_OK)
error ("target_new_objfile: td_init: %s", td_err_string (val));
- val = td_ta_new (&main_ph, &main_ta);
+ val = p_td_ta_new (&main_ph, &main_ta);
if (val == TD_NOLIBTHREAD)
return;
else if (val != TD_OK)
"Solaris threads and pthread support.", /* to_doc */
sol_thread_open, /* to_open */
0, /* to_close */
- sol_thread_attach, /* to_attach */
+ sol_thread_attach, /* to_attach */
sol_thread_detach, /* to_detach */
- sol_thread_resume, /* to_resume */
- sol_thread_wait, /* to_wait */
+ sol_thread_resume, /* to_resume */
+ sol_thread_wait, /* to_wait */
sol_thread_fetch_registers, /* to_fetch_registers */
sol_thread_store_registers, /* to_store_registers */
sol_thread_prepare_to_store, /* to_prepare_to_store */
- sol_thread_xfer_memory, /* to_xfer_memory */
- sol_thread_files_info, /* to_files_info */
+ sol_thread_xfer_memory, /* to_xfer_memory */
+ sol_thread_files_info, /* to_files_info */
memory_insert_breakpoint, /* to_insert_breakpoint */
memory_remove_breakpoint, /* to_remove_breakpoint */
terminal_init_inferior, /* to_terminal_init */
void
_initialize_sol_thread ()
{
+ void *dlhandle;
+
+ dlhandle = dlopen ("libthread_db.so.1", RTLD_NOW);
+ if (!dlhandle)
+ goto die;
+
+#define resolve(X) \
+ if (!(p_##X = dlsym (dlhandle, #X))) \
+ goto die;
+
+ resolve (td_log);
+ resolve (td_ta_new);
+ resolve (td_ta_delete);
+ resolve (td_init);
+ resolve (td_ta_get_ph);
+ resolve (td_ta_get_nthreads);
+ resolve (td_ta_tsd_iter);
+ resolve (td_ta_thr_iter);
+ resolve (td_thr_validate);
+ resolve (td_thr_tsd);
+ resolve (td_thr_get_info);
+ resolve (td_thr_getfpregs);
+ resolve (td_thr_getxregsize);
+ resolve (td_thr_getxregs);
+ resolve (td_thr_sigsetmask);
+ resolve (td_thr_setprio);
+ resolve (td_thr_setsigpending);
+ resolve (td_thr_setfpregs);
+ resolve (td_thr_setxregs);
+ resolve (td_ta_map_id2thr);
+ resolve (td_ta_map_lwp2thr);
+ resolve (td_thr_getgregs);
+ resolve (td_thr_setgregs);
+
add_target (&sol_thread_ops);
procfs_suppress_run = 1;
+
+ return;
+
+ die:
+
+ fprintf_unfiltered (gdb_stderr, "[GDB will not be able to debug user-mode threads: %s]\n", dlerror ());
+
+ if (dlhandle)
+ dlclose (dlhandle);
+
+ return;
}