[m-rev.] diff: .NET: support installing debug library

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Oct 24 16:05:43 AEST 2002


Estimated hours taken: 1
Branches: main

library/Mmakefile:
	For il grades, add a target `install_debug_library',
	which works around a problem installing debug versions
	of the library.

Workspace: /c/fjh/ws/2/mercury
Index: library/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/library/Mmakefile,v
retrieving revision 1.96
diff -u -d -r1.96 Mmakefile
--- library/Mmakefile	24 Sep 2002 06:55:15 -0000	1.96
+++ library/Mmakefile	24 Oct 2002 06:07:40 -0000
@@ -373,6 +373,33 @@
 	cp `vpath_find $($(STD_LIB_NAME).foreign_dlls) $($(STD_LIB_NAME).dlls) \
 		mercury.dll` $(INSTALL_MERC_LIB_DIR)
 
+# To build the .NET library with debugging information, add
+# the following to ../Mmake.params:
+#
+#	EXTRA_MS_ILASMFLAGS=/debug
+#	EXTRA_CSCFLAGS=/debug+ /debug:full
+#	EXTRA_MS_CLFLAGS=/Zi
+#
+# XXX Unfortunately, however, this is a problem with AL, which prohibits
+# linking debuggable C# code with IL or MC++ code.  The following
+# horrible hack avoids that problem.  After modify Mmake.params as
+# described above, invoke `mmake install_debug_library'.
+
+.PHONY: install_debug_library
+install_debug_library:
+	-mmake library
+	mmake munge_dll_debug_info
+	mmake install_library
+
+.PHONY: munge_dll_debug_info
+munge_dll_debug_info:
+	for file in *csharp_code.dll; do \
+		ildasm /out:$$file.ild; \
+		sed  's/01 00 00 01/01 00 01 01/' $$file.ild \
+			> $$file.ild.munged; \
+		ilasm /quiet /dll /debug /out:$$file $$file.ild.munged; \
+	done
+
 # The GAC is the global assembly cache, which is the system managed
 # place to put .NET assemblies.
 # gacutil installs (and uninstalls) DLLs from the GAC.
--------------------------------------------------------------------------
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