diff: change mmc to pass --c-debug down to ml

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 11 00:41:40 AEDT 1998


Estimated hours taken: 0.25

compiler/mercury_compile.m:
	If `--c-debug' is set, then when linking, pass `--no-strip' to `ml'.

doc/user_guide.texi:
compiler/options.m:
	Update the documentation of the `--c-debug' option to reflect
	the above-mentioned change.

Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.112
diff -u -r1.112 mercury_compile.m
--- mercury_compile.m	1998/11/05 03:52:23	1.112
+++ mercury_compile.m	1998/11/10 13:11:06
@@ -2355,6 +2355,12 @@
 		    maybe_write_string(Verbose, "% Linking...\n"),
 		    globals__io_get_globals(Globals),
 		    { compute_grade(Globals, Grade) },
+		    globals__io_lookup_bool_option(c_debug, C_Debug),
+		    { C_Debug = yes ->
+		    	C_Debug_Opt = "--no-strip "
+		    ;
+		    	C_Debug_Opt = ""
+		    },
 		    globals__io_lookup_accumulating_option(link_flags,
 				LinkFlagsList),
 		    { join_string_list(LinkFlagsList, "", "", " ", LinkFlags) },
@@ -2372,7 +2378,7 @@
 		    { join_string_list(LinkObjectsList, "", "", " ",
 				LinkObjects) },
 		    { string__append_list(
-			["ml --grade ", Grade, " ", LinkFlags,
+			["ml --grade ", Grade, " ", C_Debug_Opt, LinkFlags,
 			" -o ", OutputFileName, " ",
 			InitObjFileName, " ", Objects, " ",
 			LinkObjects, " ",
Index: compiler/options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.248
diff -u -r1.248 options.m
--- options.m	1998/11/05 03:52:28	1.248
+++ options.m	1998/11/10 13:22:09
@@ -1741,7 +1741,8 @@
 
 		"--c-debug",
 		"\tEnable debugging of the generated C code.",
-		"\t(This has the same effect as `--cflags -g'.)",
+		"\t(This has the same effect as",
+		"\t`--cflags ""-g"" --link-flags ""--no-strip""'.)",
 
 		"--fact-table-max-array-size <n>",
 		"\tSpecify the maximum number of elements in a single",
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.141
diff -u -r1.141 user_guide.texi
--- user_guide.texi	1998/11/05 03:53:04	1.141
+++ user_guide.texi	1998/11/10 13:10:33
@@ -2278,7 +2278,8 @@
 @sp 1
 @item @code{--c-debug}
 Pass the @samp{-g} flag to the C compiler, to enable debugging
-of the generated C code.
+of the generated C code, and also pass @samp{--no-strip} to the Mercury
+linker, to tell it not to strip the C debugging information.
 Since the generated C code is very low-level, this option is not likely
 to be useful to anyone except the Mercury implementors, except perhaps
 for debugging code that uses Mercury's C interface extensively.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh at 128.250.37.3        |     -- leaked Microsoft memo.



More information about the developers mailing list