This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdbserver Solaris [2/9] - gdbserver configs


gdb/gdbserver ChangeLog entry:

2010-04-23:  Pieter Maljaars  <pieter.maljaars@altenpts.nl>

        * config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Add Solaris configurations.
	* configure.srv: Add i[34567]86-*-solaris*) and 
        sparc*-*-solaris2*) entries.
	* Makefile.in: Add Solaris build rules.


diff -upN src-orig/src/gdb/gdbserver/config.in src/gdb/gdbserver/config.in
--- src-orig/src/gdb/gdbserver/config.in	2009-12-21 21:52:53.000000000 +0100
+++ src/gdb/gdbserver/config.in	2010-04-21 09:40:37.000000000 +0200
@@ -172,6 +175,10 @@
 /* Additional package description */
 #undef PKGVERSION
 
+/* Define if <proc_service.h> on solaris uses int instead of size_t, and
+   assorted other type changes. */
+#undef PROC_SERVICE_IS_OLD
+
 /* Bug reporting address */
 #undef REPORT_BUGS_TO
 
diff -upN src-orig/src/gdb/gdbserver/configure src/gdb/gdbserver/configure
--- src-orig/src/gdb/gdbserver/configure	2010-04-17 22:43:13.000000000 +0200
+++ src/gdb/gdbserver/configure	2010-04-21 09:46:10.000000000 +0200
@@ -3769,7 +3769,7 @@ $as_echo "#define STDC_HEADERS 1" >>conf
 fi
 
 
-for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h 		 proc_service.h sys/procfs.h thread_db.h linux/elf.h 		 stdlib.h unistd.h 		 errno.h fcntl.h signal.h sys/file.h malloc.h 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h 		 netinet/tcp.h arpa/inet.h sys/wait.h
+for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h 		 proc_service.h sys/procfs.h thread_db.h linux/elf.h 		 stdlib.h unistd.h 		 errno.h fcntl.h signal.h sys/file.h malloc.h alloca.h 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h 		 netinet/tcp.h arpa/inet.h sys/wait.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -4418,6 +4418,53 @@ if test "${with_libthread_db+set}" = set
 fi
 
 
+if test "$srv_solaris_thread_db" = "yes"; then
+  srv_cv_thread_db="-lthread_db"
+  if test "$srv_cv_thread_db" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find libthread_db." >&5
+$as_echo "$as_me: WARNING: Could not find libthread_db." >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling thread support in gdbserver." >&5
+$as_echo "$as_me: WARNING: Disabling thread support in gdbserver." >&2;}
+    srv_solaris_thread_db=no
+  else
+    srv_libs="$srv_cv_thread_db"
+  fi
+
+  srv_thread_depfiles="sol-thread-db.o proc-service.o"
+  USE_THREAD_DB="-DUSE_THREAD_DB"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TD_VERSION" >&5
+$as_echo_n "checking for TD_VERSION... " >&6; }
+if test "${gdbsrv_cv_have_td_version+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <thread_db.h>
+int
+main ()
+{
+TD_VERSION;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdbsrv_cv_have_td_version=yes
+else
+  gdbsrv_cv_have_td_version=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbsrv_cv_have_td_version" >&5
+$as_echo "$gdbsrv_cv_have_td_version" >&6; }
+  if test $gdbsrv_cv_have_td_version = yes; then
+
+$as_echo "#define HAVE_TD_VERSION 1" >>confdefs.h
+
+  fi
+fi
+
+
 if test "$srv_libs" != "" -a "$srv_libs" != "-ldl"; then
 
 $as_echo "#define USE_LIBTHREAD_DB_DIRECTLY 1" >>confdefs.h
@@ -4437,7 +4484,7 @@ $as_echo "#define USE_XML 1" >>confdefs.
   done
 fi
 
-GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles"
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles $srv_solaris_depfiles"
 GDBSERVER_LIBS="$srv_libs"
 
 
diff -upN src-orig/src/gdb/gdbserver/configure.ac src/gdb/gdbserver/configure.ac
--- src-orig/src/gdb/gdbserver/configure.ac	2010-04-17 22:43:13.000000000 +0200
+++ src/gdb/gdbserver/configure.ac	2010-04-21 09:47:13.000000000 +0200
@@ -168,6 +168,29 @@ if test "${srv_linux_regsets}" = "yes"; 
   fi
 fi
 
+srv_solaris_depfiles=
+
+if test "$srv_solaris" = "yes"; then
+  AC_MSG_CHECKING(if <proc_service.h> is old)
+  AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
+    AC_TRY_COMPILE([
+        #include <proc_service.h>
+        ps_err_e ps_pdwrite
+          (struct ps_prochandle*, psaddr_t, const void*, size_t);
+    ],, gdb_cv_proc_service_is_old=no,
+        gdb_cv_proc_service_is_old=yes)
+  ])
+  AC_MSG_RESULT($gdb_cv_proc_service_is_old)
+  if test $gdb_cv_proc_service_is_old = yes; then
+    AC_DEFINE(PROC_SERVICE_IS_OLD, 1,
+    [Define if <proc_service.h> on solaris uses int instead of 
+     size_t, and assorted other type changes.])
+  fi
+
+  srv_solaris_depfiles="procfs.o proc-why.o proc-events.o proc-flags.o"
+  LIBS="$LIBS -lsocket  -lnsl"
+fi
+
 if test "$ac_cv_header_sys_procfs_h" = yes; then
   BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
   BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
@@ -214,6 +237,27 @@ AS_HELP_STRING([--with-libthread-db=PATH
   srv_libs="$srv_libthread_db_path"
 ])
 
+if test "$srv_solaris_thread_db" = "yes"; then
+  srv_cv_thread_db="-lthread_db"
+  if test "$srv_cv_thread_db" = no; then
+    AC_WARN([Could not find libthread_db.])
+    AC_WARN([Disabling thread support in gdbserver.])
+    srv_solaris_thread_db=no
+  else
+    srv_libs="$srv_cv_thread_db"
+  fi
+
+  srv_thread_depfiles="sol-thread-db.o proc-service.o"
+  USE_THREAD_DB="-DUSE_THREAD_DB"
+  AC_CACHE_CHECK([for TD_VERSION], gdbsrv_cv_have_td_version,
+  [AC_TRY_COMPILE([#include <thread_db.h>], [TD_VERSION;],
+                  [gdbsrv_cv_have_td_version=yes],
+                  [gdbsrv_cv_have_td_version=no])])
+  if test $gdbsrv_cv_have_td_version = yes; then
+    AC_DEFINE(HAVE_TD_VERSION, 1, [Define if TD_VERSION is available.])
+  fi
+fi
+
 if test "$srv_libs" != "" -a "$srv_libs" != "-ldl"; then
   AC_DEFINE(USE_LIBTHREAD_DB_DIRECTLY, 1, [Define if we should use libthread_db directly.])
 fi
@@ -229,7 +273,7 @@ if test "$srv_xmlfiles" != ""; then
   done
 fi
 
-GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles"
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles $srv_solaris_depfiles"
 GDBSERVER_LIBS="$srv_libs"
 
 AC_SUBST(GDBSERVER_DEPFILES)
diff -upN src-orig/src/gdb/gdbserver/configure.srv src/gdb/gdbserver/configure.srv
--- src-orig/src/gdb/gdbserver/configure.srv	2010-04-20 02:19:35.000000000 +0200
+++ src/gdb/gdbserver/configure.srv	2010-04-21 09:49:21.000000000 +0200
@@ -107,6 +107,11 @@ case "${target}" in
 			srv_xmlfiles="$srv_i386_xmlfiles"
 			srv_qnx="yes"
 			;;
+  i[34567]86-*-solaris*) srv_regobj="$srv_i386_regobj"
+			srv_tgtobj="solaris-low.o solaris-i386-low.o i387-fp.o"
+			srv_solaris_thread_db=yes
+			srv_solaris=yes
+			;;
   ia64-*-linux*)	srv_regobj=reg-ia64.o
 			srv_tgtobj="linux-low.o linux-ia64-low.o"
 			srv_linux_usrregs=yes
@@ -221,6 +226,11 @@ case "${target}" in
 			srv_linux_regsets=yes
 			srv_linux_thread_db=yes
 			;;
+  sparc*-*-solaris2*)	srv_regobj=reg-sparc32.o
+  			srv_tgtobj="solaris-low.o solaris-sparc-low.o"
+			srv_solaris_thread_db=yes
+			srv_solaris=yes
+			;;
   spu*-*-*)		srv_regobj=reg-spu.o
 			srv_tgtobj="spu-low.o"
 			;;
diff -upN src-orig/src/gdb/gdbserver/Makefile.in src/gdb/gdbserver/Makefile.in
--- src-orig/src/gdb/gdbserver/Makefile.in	2010-04-23 11:32:08.000000000 +0200
+++ src/gdb/gdbserver/Makefile.in	2010-04-23 11:17:25.000000000 +0200
@@ -102,7 +102,7 @@ INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@
 SFILES=	$(srcdir)/gdbreplay.c $(srcdir)/inferiors.c \
 	$(srcdir)/mem-break.c $(srcdir)/proc-service.c $(srcdir)/regcache.c \
 	$(srcdir)/remote-utils.c $(srcdir)/server.c $(srcdir)/target.c \
-	$(srcdir)/thread-db.c $(srcdir)/utils.c \
+	$(srcdir)/thread-db.c $(srcdir)/sol-thread-db.c $(srcdir)/utils.c \
 	$(srcdir)/linux-arm-low.c $(srcdir)/linux-cris-low.c \
 	$(srcdir)/linux-crisv32-low.c \
 	${srcdir}/i386-low.c $(srcdir)/i387-fp.c \
@@ -116,7 +116,9 @@ SFILES=	$(srcdir)/gdbreplay.c $(srcdir)/
 	$(srcdir)/linux-xtensa-low.c \
 	$(srcdir)/win32-arm-low.c $(srcdir)/win32-i386-low.c \
 	$(srcdir)/win32-low.c $(srcdir)/wincecompat.c \
-	$(srcdir)/hostio.c $(srcdir)/hostio-errno.c
+	$(srcdir)/hostio.c $(srcdir)/hostio-errno.c \
+	$(srcdir)/procfs.c $(srcdir)/solaris-low.c \
+	$(srcdir)/proc-why.c $(srcdir)/proc-flags.c
 
 DEPFILES = @GDBSERVER_DEPFILES@
 
@@ -206,6 +208,7 @@ clean:
 	rm -f reg-arm.c i386.c reg-ia64.c reg-m32r.c reg-m68k.c
 	rm -f reg-sh.c reg-sparc.c reg-spu.c amd64.c i386-linux.c
 	rm -f reg-cris.c reg-crisv32.c amd64-linux.c reg-xtensa.c
+	rm -f reg-sparc32.c
 	rm -f arm-with-iwmmxt.c
 	rm -f arm-with-vfpv2.c arm-with-vfpv3.c arm-with-neon.c
 	rm -f mips-linux.c mips64-linux.c
@@ -288,6 +291,7 @@ server.o: server.c $(server_h)
 target.o: target.c $(server_h)
 thread-db.o: thread-db.c $(server_h) $(linux_low_h) $(gdb_proc_service_h)
 tracepoint.o: tracepoint.c $(server_h)
+sol-thread-db.o: sol-thread-db.c $(server_h) $(gdb_proc_service_h)
 utils.o: utils.c $(server_h)
 gdbreplay.o: gdbreplay.c config.h
 
@@ -331,6 +335,12 @@ win32-low.o: win32-low.c $(win32_low_h) 
 win32-arm-low.o: win32-arm-low.c $(win32_low_h) $(server_h)
 win32-i386-low.o: win32-i386-low.c $(win32_low_h) $(server_h) $(i386_low_h)
 
+solaris-low.o : solaris-low.c
+procfs.o : procfs.c
+proc-why.o : proc-why.c
+proc-events.o : proc-events.c
+proc-flags.o : proc-flags.c
+
 spu-low.o: spu-low.c $(server_h)
 
 reg-arm.o : reg-arm.c $(regdef_h)
@@ -447,6 +457,9 @@ s390x-linux64.c : $(srcdir)/../regformat
 reg-sh.o : reg-sh.c $(regdef_h)
 reg-sh.c : $(srcdir)/../regformats/reg-sh.dat $(regdat_sh)
 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-sh.dat reg-sh.c
+reg-sparc32.o : reg-sparc32.c $(regdat_sh)
+reg-sparc32.c : $(srcdir)/../regformats/reg-sparc32.dat $(regdat_sh)
+	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-sparc32.dat reg-sparc32.c
 reg-sparc64.o : reg-sparc64.c $(regdef_h)
 reg-sparc64.c : $(srcdir)/../regformats/reg-sparc64.dat $(regdat_sh)
 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-sparc64.dat reg-sparc64.c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]