+2011-03-17 Joel Brobecker <brobecker@gnat.com>
+
+ PR gdb/12116:
+ * configure.ac: Add getthrds declaration check.
+ * configure, config.in: Regenerate.
+ * aix-thread.c (getthrds): Declare only if not already declared
+ in procinfo.h. More declaration out of get_signaled_thread to
+ global scope.
+
2011-03-17 Phil Muldoon <pmuldoon@redhat.com>
* python/py-symtab.c: Populate symtab_object_methods,
#include <sched.h>
#include <sys/pthdebug.h>
+#if !HAVE_DECL_GETTHRDS
+extern int getthrds (pid_t, struct thrdsinfo64 *, int, pthdb_tid_t *, int);
+#endif
+
/* Whether to emit debugging output. */
static int debug_aix_thread;
pthdb_tid_t ktid = 0;
int result = 0;
- /* getthrds(3) isn't prototyped in any AIX 4.3.3 #include file. */
- extern int getthrds (pid_t, struct thrdsinfo64 *,
- int, pthdb_tid_t *, int);
-
while (1)
{
if (getthrds (PIDGET (inferior_ptid), &thrinf,
*/
#undef HAVE_DECL_GETOPT
+/* Define to 1 if you have the declaration of `getthrds', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETTHRDS
+
/* Define to 1 if you have the declaration of `malloc', and to 0 if you don't.
*/
#undef HAVE_DECL_MALLOC
CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
CONFIG_OBS="${CONFIG_OBS} aix-thread.o"
CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug"
+
+ # Older versions of AIX do not provide the declaration for
+ # the getthrds function (it appears that it was introduced
+ # with AIX 6.x).
+ ac_fn_c_check_decl "$LINENO" "getthrds" "ac_cv_have_decl_getthrds" "#include <procinfo.h>
+"
+if test "x$ac_cv_have_decl_getthrds" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETTHRDS $ac_have_decl
+_ACEOF
+
fi
;;
esac
CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
CONFIG_OBS="${CONFIG_OBS} aix-thread.o"
CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug"
+
+ # Older versions of AIX do not provide the declaration for
+ # the getthrds function (it appears that it was introduced
+ # with AIX 6.x).
+ AC_CHECK_DECLS(getthrds, [], [], [[#include <procinfo.h>]])
fi
;;
esac