for review: add --enable-decl-debug option to configure

Mark Anthony BROWN dougl at cs.mu.OZ.AU
Fri Apr 16 00:06:52 AEST 1999


Hi,

This is a change that Fergus suggested earlier (and partly
implemented).

Cheers,
Mark.


Estimated hours taken: 2

Add the option `--enable-decl-debug' to configure, which enables
declarative debugging support in the internal debugger.

configure.in:
	Add the option to configure.

browser/declarative_debugger.m:
runtime/mercury_wrapper.c:
	Avoid using MR_address_of_edt_root_node unless configured
	for declarative debugging.

runtime/mercury_conf.h.in:
runtime/mercury_conf_param.h:
	Move the configuration macro to mercury_conf.h.in.

trace/mercury_trace_declarative.c:
	Define MR_edt_root_node only if configured for declarative
	debugging, thereby undoing a previous change.


Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.159
diff -u -r1.159 configure.in
--- configure.in	1999/04/07 13:13:32	1.159
+++ configure.in	1999/04/15 13:16:54
@@ -1494,6 +1494,17 @@
 MERCURY_MSG("using \`LIBGRADES=$LIBGRADES' as the set of library grades to install")
 AC_SUBST(LIBGRADES)
 #-----------------------------------------------------------------------------#
+#
+# Add an option that enables declarative debugging support in the internal
+# debugger.  It is disabled by default.
+#
+AC_ARG_ENABLE(decl-debug,
+[  --enable-decl-debug     enable the declarative debugger],
+mercury_cv_enable_decl_debug=yes,mercury_cv_enable_decl_debug=no)
+if test $mercury_cv_enable_decl_debug = "yes"; then
+	AC_DEFINE(MR_USE_DECLARATIVE_DEBUGGER)
+fi
+#-----------------------------------------------------------------------------#
 
 # Determine how many of the r registers (r1, r2, ...) are real registers.
 # Determine how many temporaries may be allocated real registers.
Index: browser/declarative_debugger.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_debugger.m,v
retrieving revision 1.2
diff -u -r1.2 declarative_debugger.m
--- declarative_debugger.m	1999/04/14 14:08:41	1.2
+++ declarative_debugger.m	1999/04/15 10:15:53
@@ -138,13 +138,17 @@
 :- pragma c_code(edt_root(EDT::in, Root::out),
 	[will_not_call_mercury],
 	"
-		/*
-		** We wish to call MR_edt_root_node in the trace
-		** directory, but due to problems with linking we
-		** call it indirectly via a pointer defined in
-		** runtime/mercury_wrapper.c.
-		*/
-		MR_address_of_edt_root_node(EDT, &Root);
+		#ifdef MR_USE_DECLARATIVE_DEBUGGER
+			/*
+			** We wish to call MR_edt_root_node in the trace
+			** directory, but due to problems with linking we
+			** call it indirectly via a pointer defined in
+			** runtime/mercury_wrapper.c.
+			*/
+			MR_address_of_edt_root_node(EDT, &Root);
+		#else
+			fatal_error(\"this should never be reached\");
+		#endif
 	"
 ).
 
Index: runtime/mercury_conf.h.in
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_conf.h.in,v
retrieving revision 1.13
diff -u -r1.13 mercury_conf.h.in
--- mercury_conf.h.in	1999/04/01 06:11:24	1.13
+++ mercury_conf.h.in	1999/04/15 09:57:44
@@ -261,6 +261,12 @@
 #undef  MR_USE_EXTERNAL_DEBUGGER
 
 /*
+** MR_USE_DECLARATIVE_DEBUGGER:
+**	Include declarative debugging support in the internal debugger.
+*/
+#undef	MR_USE_DECLARATIVE_DEBUGGER
+
+/*
 ** MR_NO_USE_READLINE
 **	Set this if you want to prevent the debugger from using the GNU
 **	readline library for the command-line prompt.
Index: runtime/mercury_conf_param.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_conf_param.h,v
retrieving revision 1.16
diff -u -r1.16 mercury_conf_param.h
--- mercury_conf_param.h	1999/04/12 04:11:44	1.16
+++ mercury_conf_param.h	1999/04/15 09:57:44
@@ -110,9 +110,6 @@
 **	Causes the generated code to become VERY big and VERY inefficient.
 **	Slows down compilation a LOT.
 **
-** MR_USE_DECLARATIVE_DEBUGGER
-**	Enables declarative debugging support in the internal debugger.
-**
 ** MR_DEBUG_DD_BACK_END
 **	Enables low-level debugging messages on the operation of the
 **	declarative debugging back end.
Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.33
diff -u -r1.33 mercury_wrapper.c
--- mercury_wrapper.c	1999/04/14 14:09:00	1.33
+++ mercury_wrapper.c	1999/04/15 09:57:44
@@ -139,7 +139,9 @@
 void	(*MR_address_of_trace_final_external)(void);
 #endif
 
+#ifdef	MR_USE_DECLARATIVE_DEBUGGER
 void	(*MR_address_of_edt_root_node)(Word, Word *);
+#endif
 
 #ifdef CONSERVATIVE_GC
 void	(*address_of_init_gc)(void);
Index: trace/mercury_trace_declarative.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_declarative.c,v
retrieving revision 1.4
diff -u -r1.4 mercury_trace_declarative.c
--- mercury_trace_declarative.c	1999/04/14 14:09:13	1.4
+++ mercury_trace_declarative.c	1999/04/15 09:57:45
@@ -559,11 +559,4 @@
 	return arglist;
 }
 
-#else	/* not MR_USE_DECLARATIVE_DEBUGGER */
-
-extern void
-MR_edt_root_node(Word EDT, Word *Node)
-{
-	fatal_error("MR_edt_root_node should not have been called");
-}
 #endif

-- 
Mark Brown  (dougl at cs.mu.oz.au)       )O+   |  For Microsoft to win,
MEngSc student,                             |  the customer must lose
Dept of Computer Science, Melbourne Uni     |          -- Eric S. Raymond



More information about the developers mailing list