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

Erwan Jahier Erwan.Jahier at irisa.fr
Wed Mar 10 04:04:29 AEDT 1999


Here is a relative diff and a diff taking into account Fergus suggestions.

**************************************************************************
* relative Diff

--- 0.15/configure.in Tue, 09 Mar 1999 09:12:56 +0100 jahier (submitdiff/21_configure. 1.1 640)
+++ 0.15(w)/configure.in Tue, 09 Mar 1999 17:46:08 +0100 jahier (submitdiff/21_configure. 1.1 640)
@@ -1858,8 +1859,7 @@
 	sparc-sun-solaris2.*)
 		AC_MSG_RESULT(yes)        
 		AC_DEFINE(MR_USE_EXTERNAL_DEBUGGER)
-		EXTRA_CFLAGS=" -lsocket"
-		EXTRA_MLFLAGS=" -lsocket"
+		SOCKET_LIBRARY=" -lsocket"
 		;;
 	alpha-dec-osf*)
 		AC_MSG_RESULT(disabled for now because it is untested)
@@ -1868,12 +1868,11 @@
 		AC_MSG_RESULT(disabled for now because it is untested)
 		;;
 	*)
-		AC_MSG_RESULT(no)
+		AC_MSG_RESULT(unknown system, assuming no)
 		;;
 esac
-
-AC_SUBST(EXTRA_CFLAGS)
-AC_SUBST(EXTRA_MLFLAGS)
+ 
+AC_SUBST(SOCKET_LIBRARY)
 
 #-----------------------------------------------------------------------------#
 AC_OUTPUT(Mmake.common scripts/Mmake.vars scripts/mmc scripts/mprof
Index: bindist/bindist.configure.in
--- 0.15/bindist/bindist.configure.in Tue, 09 Mar 1999 09:12:56 +0100 jahier (submitdiff/22_bindist.co 1.1 640)
+++ 0.15(w)/bindist/bindist.configure.in Tue, 09 Mar 1999 17:45:54 +0100 jahier (submitdiff/22_bindist.co 1.1 640)
@@ -251,22 +251,20 @@
 	sparc-sun-solaris2.*)
 		AC_MSG_RESULT(yes)        
 		AC_DEFINE(MR_USE_EXTERNAL_DEBUGGER)
-		EXTRA_CFLAGS=" -lsocket"
-		EXTRA_MLFLAGS=" -lsocket"
+		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(no)
+		AC_MSG_RESULT(unknown system, assuming no)
 		;;
 esac
 
-AC_SUBST(EXTRA_CFLAGS)
-AC_SUBST(EXTRA_MLFLAGS)
+AC_SUBST(SOCKET_LIBRARY)
 
 #-----------------------------------------------------------------------------#
 AC_OUTPUT(Makefile scripts/mmc scripts/mprof
Index: Mmake.common.in
--- 0.15/Mmake.common.in Tue, 09 Mar 1999 09:12:56 +0100 jahier (submitdiff/23_Mmake.comm 1.1 640)
+++ 0.15(w)/Mmake.common.in Tue, 09 Mar 1999 17:39:27 +0100 jahier (submitdiff/23_Mmake.comm 1.1 640)
@@ -199,13 +199,20 @@
 
 # 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 those two variables. 
-EXTRA_CFLAGS	= @EXTRA_CFLAGS@
-EXTRA_MLFLAGS	= @EXTRA_MLFLAGS@
+# and passed through this variable.
+SOCKET_LIBRARY	= @SOCKET_LIBRARY@
+EXTRA_CFLAGS	=
+EXTRA_MLFLAGS	=
 
 #-----------------------------------------------------------------------------#
 
 # The Mmake.params file can be used to override definitions in this file
 -include $(MERCURY_DIR)/Mmake.params
+
+#-----------------------------------------------------------------------------#
+
+# Add the name of the soket library to those variables.
+EXTRA_CFLAGS	+= $(SOCKET_LIBRARY)
+EXTRA_MLFLAGS	+= $(SOCKET_LIBRARY)
 
 #-----------------------------------------------------------------------------#
Index: runtime/mercury_conf.h
--- 0.16/runtime/mercury_conf.h Tue, 09 Mar 1999 17:55:06 +0100 jahier (submitdi
ff/24_mercury_co 1.1 640)
+++ 0.16(w)/runtime/mercury_conf.h Tue, 09 Mar 1999 17:58:47 +0100 jahier (submi
tdiff/24_mercury_co 1.1 640)
@@ -246,6 +246,8 @@
 **     (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.
 */
 #define  MR_USE_EXTERNAL_DEBUGGER 1
 


**************************************************************************
* Diff

Estimated hours taken: 7

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).

Mmake.common.in:
	Add the name of the socket library to the variables
	EXTRA_CFLAGS and EXTRA_MLFLAGS.

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: Mmake.common.in
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.common.in,v
retrieving revision 1.35
diff -u -r1.35 Mmake.common.in
--- Mmake.common.in	1998/12/21 11:33:49	1.35
+++ Mmake.common.in	1999/03/09 16:48:41
@@ -197,9 +197,22 @@
 # complicating things.
 LIBRARY_INTERMODULE = yes
 
+# 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@
+EXTRA_CFLAGS	=
+EXTRA_MLFLAGS	=
+
 #-----------------------------------------------------------------------------#
 
 # The Mmake.params file can be used to override definitions in this file
 -include $(MERCURY_DIR)/Mmake.params
+
+#-----------------------------------------------------------------------------#
+
+# Add the name of the soket library to those variables.
+EXTRA_CFLAGS	+= $(SOCKET_LIBRARY)
+EXTRA_MLFLAGS	+= $(SOCKET_LIBRARY)
 
 #-----------------------------------------------------------------------------#
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/09 16:48:52
@@ -1839,6 +1839,41 @@
 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
+ 
+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/09 16:48:55
@@ -233,6 +233,40 @@
 
 #-----------------------------------------------------------------------------#
 
+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
+
+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/09 16:49:10
@@ -239,6 +239,15 @@
 */
 #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/09 16:49:11
@@ -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: 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/09 16:49:16
@@ -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