[m-rev.] for review: port 0.12 branch to mingw

Ian MacLarty maclarty at cs.mu.OZ.AU
Wed Oct 19 19:58:08 AEST 2005


The diff to port the 0.12 branch to mingw is the same as the diff to port the
main branch to mingw, except for the following differences:

boehm_gc/if_not_there.c:
	Check if SIGPROF is defined, because it isn't on MinGW.

trace/mercury_trace.c:
	On MinGW the external debugger is not enabled, because sockets
	don't work.  This means that MR_trace_event_internal is invoked
	with the incorrect number of arguments.  Fix this.

Index: boehm_gc/if_not_there.c
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/if_not_there.c,v
retrieving revision 1.7
diff -u -r1.7 if_not_there.c
--- boehm_gc/if_not_there.c	20 May 2004 04:25:29 -0000	1.7
+++ boehm_gc/if_not_there.c	19 Oct 2005 08:34:32 -0000
@@ -12,7 +12,9 @@
 char ** envp;
 {
     FILE * f;
+#ifdef SIGPROF
     signal(SIGPROF, SIG_IGN);
+#endif
     if (argc < 3) goto Usage;
     if ((f = fopen(argv[1], "rb")) != 0
         || (f = fopen(argv[1], "r")) != 0) {
Index: trace/mercury_trace.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace.c,v
retrieving revision 1.78.2.2
diff -u -r1.78.2.2 mercury_trace.c
--- trace/mercury_trace.c	16 Aug 2005 07:17:21 -0000	1.78.2.2
+++ trace/mercury_trace.c	19 Oct 2005 09:03:19 -0000
@@ -467,27 +467,33 @@
     MR_copy_regs_to_saved_regs(event_info.MR_max_mr_num, saved_regs);

 #ifdef MR_USE_EXTERNAL_DEBUGGER
-    if (MR_trace_handler == MR_TRACE_EXTERNAL) {
-        if (!interactive) {
-            MR_fatal_error("reporting event for external debugger");
-        }
+    switch (MR_trace_handler) {
+        case MR_TRACE_EXTERNAL:
+            if (!interactive) {
+                MR_fatal_error("reporting event for external debugger");
+            }

-        jumpaddr = MR_trace_event_external(cmd, &event_info);
-    } else {
-        MR_Spy_Action       action;         /* ignored */
-        MR_Spy_Print_List   print_list;
+            jumpaddr = MR_trace_event_external(cmd, &event_info);
+            break;

-        (void) MR_event_matches_spy_point(layout, port, &action, &print_list);
-        jumpaddr = MR_trace_event_internal(cmd, interactive, print_list,
-            &event_info);
-    }
-#else
-    /*
-    ** We should get here only if MR_trace_handler == MR_TRACE_INTERNAL.
-    ** This is enforced by mercury_wrapper.c.
-    */
+        case MR_TRACE_INTERNAL:
+#endif
+            /*
+            ** MR_TRACE_INTERNAL is the only possible value of MR_trace_handler
+            ** if MR_USE_EXTERNAL_DEBUGGER is not defined.
+            */
+            {
+                MR_Spy_Action       action;         /* ignored */
+                MR_Spy_Print_List   print_list;

-    jumpaddr = MR_trace_event_internal(cmd, interactive, &event_info);
+                (void) MR_event_matches_spy_point(layout, port, &action,
+                    &print_list);
+                jumpaddr = MR_trace_event_internal(cmd, interactive,
+                    print_list, &event_info);
+            }
+#ifdef MR_USE_EXTERNAL_DEBUGGER
+            break;
+        }
 #endif

     /*

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