[m-dev.] For review: Enable by default the use of the external debugger

Erwan Jahier Erwan.Jahier at irisa.fr
Thu Mar 11 22:46:16 AEDT 1999


Estimated hours taken: 9

Enable by default the use of the external debugger on architectures that
support sockets.

configure.in:
bindist/bindist.configure.in:
	Define MR_USE_EXTERNAL_DEBUGGER for systems that support sockets.

	Pass down a variable SOCKET_LIBRARY that contains the name of the 
	socket library (may varies from one system to another).

script/ml.in:
	Add the name of the socket library to the libraries passed in 
	argument of ml.

runtime/mercury_conf.h.in:
	Add "#undef  MR_USE_EXTERNAL_DEBUGGER".

runtime/mercury_conf_param.h:
	Remove a useless comment.

trace/mercury_trace_external.c:
	Update a comment.

Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.149
diff -u -r1.149 configure.in
--- configure.in	1999/02/21 10:09:31	1.149
+++ configure.in	1999/03/11 08:38:16
@@ -1839,6 +1839,43 @@
 AC_SUBST_FILE(PARSE_GRADE_OPTIONS)
 AC_SUBST_FILE(FINAL_GRADE_OPTIONS)
 
+
+#-----------------------------------------------------------------------------#
+AC_MSG_CHECKING(whether we can use sockets (for Opium-M))
+# test if sockets are available to be able to use Opium-M
+# XXX It would be better to use AC_TRY_RUN() to do that
+
+SOCKET_LIBRARY= 
+
+case "$host" in
+	i?86-*-linux|i?86-*-linux-gnu)
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(MR_USE_EXTERNAL_DEBUGGER)
+		;;
+	m68*-linux|m68*-linux-gnu)
+		AC_MSG_RESULT(disabled for now because it is untested)
+		;;
+	i?86-*-freebsd*)
+		AC_MSG_RESULT(disabled for now because it is untested)
+		;;
+	sparc-sun-solaris2.*)
+		AC_MSG_RESULT(yes)        
+		AC_DEFINE(MR_USE_EXTERNAL_DEBUGGER)
+		SOCKET_LIBRARY=" -lsocket"
+		;;
+	alpha-dec-osf*)
+		AC_MSG_RESULT(disabled for now because it is untested)
+		;;
+	*-cygwin*)
+		AC_MSG_RESULT(disabled for now because it is untested)
+		;;
+	*)
+		AC_MSG_RESULT(unknown system, assuming no)
+		;;
+esac
+ 
+AC_SUBST(SOCKET_LIBRARY)
+
 #-----------------------------------------------------------------------------#
 AC_OUTPUT(Mmake.common scripts/Mmake.vars scripts/mmc scripts/mprof
 scripts/mercury_update_interface scripts/mgnuc scripts/ml
Index: bindist/bindist.configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/bindist/bindist.configure.in,v
retrieving revision 1.21
diff -u -r1.21 bindist.configure.in
--- bindist.configure.in	1998/12/22 07:54:12	1.21
+++ bindist.configure.in	1999/03/11 08:38:16
@@ -233,6 +233,42 @@
 
 #-----------------------------------------------------------------------------#
 
+AC_MSG_CHECKING(whether we can use sockets (for Opium-M))
+# test if sockets are available to be able to use Opium-M
+# XXX It would be better to use AC_TRY_RUN() to do that
+
+SOCKET_LIBRARY=
+
+case "$host" in
+	i?86-*-linux|i?86-*-linux-gnu)
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(MR_USE_EXTERNAL_DEBUGGER)
+		;;
+	m68*-linux|m68*-linux-gnu)
+		AC_MSG_RESULT(disabled for now because it is untested)
+		;;
+	i?86-*-freebsd*)
+		AC_MSG_RESULT(disabled for now because it is untested)
+		;;
+	sparc-sun-solaris2.*)
+		AC_MSG_RESULT(yes)        
+		AC_DEFINE(MR_USE_EXTERNAL_DEBUGGER)
+		SOCKET_LIBRARY=" -lsocket"
+		;;
+	alpha-dec-osf*)
+		AC_MSG_RESULT(disabled for now because it is untested)
+		;;
+	*-cygwin*)
+		AC_MSG_RESULT(disabled for now because it is untested)
+		;;
+	*)
+		AC_MSG_RESULT(unknown system, assuming no)
+		;;
+esac
+
+AC_SUBST(SOCKET_LIBRARY)
+
+#-----------------------------------------------------------------------------#
 AC_OUTPUT(Makefile scripts/mmc scripts/mprof
 scripts/mercury_update_interface scripts/mgnuc scripts/ml
 scripts/mmake scripts/mnc scripts/mnl scripts/mnp scripts/c2init
Index: runtime/mercury_conf.h.in
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_conf.h.in,v
retrieving revision 1.9
diff -u -r1.9 mercury_conf.h.in
--- mercury_conf.h.in	1998/12/15 00:22:11	1.9
+++ mercury_conf.h.in	1999/03/11 08:38:19
@@ -239,6 +239,17 @@
 */
 #undef MR_CAN_DO_PENDING_IO
 
+/*
+** MR_USE_EXTERNAL_DEBUGGER:
+**	Allow MR_trace() to use an external process debugger
+**	(with communication done via a socket interface)
+**	rather than using the debugger that is part of
+**	the Mercury runtime.
+**	This requires that the system support sockets.
+**	See trace/mercury_trace_external.c.
+*/
+#undef  MR_USE_EXTERNAL_DEBUGGER
+
 /*---------------------------------------------------------------------------*/
 
 #include "mercury_conf_param.h"
Index: runtime/mercury_conf_param.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_conf_param.h,v
retrieving revision 1.14
diff -u -r1.14 mercury_conf_param.h
--- mercury_conf_param.h	1999/01/11 03:52:05	1.14
+++ mercury_conf_param.h	1999/03/11 08:38:19
@@ -103,13 +103,6 @@
 **	Note that MR_REQUIRE_TRACING is talking about execution tracing,
 **	not stack tracing; these are two independently configurable features.
 **
-** MR_USE_EXTERNAL_DEBUGGER:
-**	Allow MR_trace() to use an external process debugger
-**	(with communication done via a socket interface)
-**	rather than using the debugger that is part of
-**	the Mercury runtime.
-**	[The external debugger has not yet been written.]
-**
 ** MR_LOWLEVEL_DEBUG
 **	Enables various low-level debugging stuff,
 **	that was in the distant past used to debug
Index: scripts/ml.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/ml.in,v
retrieving revision 1.51
diff -u -r1.51 ml.in
--- ml.in	1999/02/20 15:30:42	1.51
+++ ml.in	1999/03/11 08:38:20
@@ -85,6 +85,11 @@
 SHLIB_RPATH_SEP=${MERCURY_SHLIB_RPATH_SEP="@SHLIB_RPATH_SEP@"}
 SHARED_LIBS=${MERCURY_SHARED_LIBS="@SHARED_LIBS@"}
 
+# On some systems (Solaris for exemple), we need libraries to be able to 
+# use sockets. The name of the needed libraries is determined by autoconf
+# and passed through this variable.
+SOCKET_LIBRARY=" @SOCKET_LIBRARY@"
+
 # If you change these, you will also need to change Mmake.common.in,
 # scripts/c2init.in, tools/bootcheck, tools/binary, tools/binary_step
 # and tools/linear.
@@ -387,6 +392,8 @@
 		merc_shlib_dirs=""
 		;;
 esac
+LIBS=${LIBS}${SOCKET_LIBRARY}
+
 
 RPATH_OPT_LIST=
 # only set RPATH_OPT_LIST if the system supports shared libraries
 esac
Index: trace/mercury_trace_external.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_external.c,v
retrieving revision 1.11
diff -u -r1.11 mercury_trace_external.c
--- mercury_trace_external.c	1999/02/22 08:28:32	1.11
+++ mercury_trace_external.c	1999/03/11 08:38:21
@@ -13,9 +13,8 @@
 ** available from http://www.irisa.fr/lande/ducasse.
 **
 ** The code for using an external debugger is conditionalized
-** on MR_USE_EXTERNAL_DEBUGGER (which by default is not enabled)
-** because it uses sockets, which are not portable.
-** Ideally we ought to use autoconf for that...
+** on MR_USE_EXTERNAL_DEBUGGER which is enabled for systems that support
+** sockets.
 **
 ** Main authors: Erwan Jahier and Fergus Henderson.
 */

-- 
R1.





More information about the developers mailing list