[m-rev.] For review: Fix seg fault bug in declarative debugger.

Ian MacLarty maclarty at cs.mu.OZ.AU
Wed Nov 24 00:12:52 AEDT 2004


For review by anyone.

Estimated hours taken: 5
Branches: main

Fix seg fault bug in declarative debugger.

Allow shared libraries to be linked against using lmc.

browser/declarative_tree.m
	The will_not_call_mercury promise was a fib, since 
	ML_bool_return_yes/no were exported Mercury procs.  So just return 
	constants instead.

tools/lmc.in
	Allow shared versions of the libraries to be linked against using
	lmc.  I needed this since the seg fault only occured when linking
	against the shared versions of the libraries.

Index: browser/declarative_tree.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_tree.m,v
retrieving revision 1.9
diff -u -r1.9 declarative_tree.m
--- browser/declarative_tree.m	19 Nov 2004 11:54:17 -0000	1.9
+++ browser/declarative_tree.m	23 Nov 2004 12:43:12 -0000
@@ -1455,9 +1455,9 @@
 	[promise_pure, will_not_call_mercury, thread_safe],
 "
 	#ifdef MR_EXEC_TRACE
-		TracingOn = ML_bool_return_yes();
+		TracingOn = MR_TRUE;
 	#else
-		TracingOn = ML_bool_return_no();
+		TracingOn = MR_FALSE;
 	#endif
 ").
 
Index: tools/lmc.in
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/lmc.in,v
retrieving revision 1.4
diff -u -r1.4 lmc.in
--- tools/lmc.in	20 May 2004 04:26:16 -0000	1.4
+++ tools/lmc.in	23 Nov 2004 13:08:34 -0000
@@ -49,6 +49,12 @@
 # If you want to track down some low level bug, you can ask this script to
 # execute the Mercury compiler under gdb by setting the environment variable
 # MMC_UNDER_GDB to the string "true".
+#
+# If you want to link in the shared versions of the Mercury libraries then set
+# the environment variable MMC_USE_SHARED_LIBS to the extension for shared
+# libraries on your system.  You also still need to pass "--mercury-linkage
+# shared" to your workspace mmc script.
+#
 
 if test ! -d $WORKSPACE
 then
@@ -63,21 +69,28 @@
 fi
 export MERCURY_COMPILER
 
-if test -s $WORKSPACE/boehm_gc/libgc.a
+if test "$MMC_USE_SHARED_LIBS" != ""
 then
-	gclib="$WORKSPACE/boehm_gc/libgc.a"
-elif test -s $WORKSPACE/boehm_gc/libpar_gc.a
+	O="$MMC_USE_SHARED_LIBS"
+else
+	O="a"
+fi
+
+if test -s $WORKSPACE/boehm_gc/libgc.$O
+then
+	gclib="$WORKSPACE/boehm_gc/libgc.$O"
+elif test -s $WORKSPACE/boehm_gc/libpar_gc.$O
 then
-	gclib="$WORKSPACE/boehm_gc/libpar_gc.a"
-elif test -s $WORKSPACE/boehm_gc/libgc_prof.a
+	gclib="$WORKSPACE/boehm_gc/libpar_gc.$O"
+elif test -s $WORKSPACE/boehm_gc/libgc_prof.$O
 then
-	gclib="$WORKSPACE/boehm_gc/libgc_prof.a"
+	gclib="$WORKSPACE/boehm_gc/libgc_prof.$O"
 else
 	echo "$WORKSPACE/boehm_gc does not have a gc library"
 fi
 
-LIB_FLAGS="--link-object $WORKSPACE/trace/libmer_trace.a --link-object
-$WORKSPACE/browser/libmer_browser.a --link-object $WORKSPACE/browser/libmer_mdbcomp.a --link-object $WORKSPACE/library/libmer_std.a --link-object $WORKSPACE/runtime/libmer_rt.a --link-object $gclib -lm @TRACE_LIBS_SYSTEM@ @READLINE_LIBRARIES@"
+LIB_FLAGS="--link-object $WORKSPACE/trace/libmer_trace.$O --link-object
+$WORKSPACE/browser/libmer_browser.$O --link-object $WORKSPACE/browser/libmer_mdbcomp.$O --link-object $WORKSPACE/library/libmer_std.$O --link-object $WORKSPACE/runtime/libmer_rt.$O --link-object $gclib -lm @TRACE_LIBS_SYSTEM@ @READLINE_LIBRARIES@"
 
 INIT_FLAGS="--trace-init-file $WORKSPACE/browser/mer_browser.init --init-file $WORKSPACE/library/mer_std.init --init-file $WORKSPACE/runtime/mer_rt.init"
 
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list