[MLton-commit] r4199

Matthew Fluet MLton@mlton.org
Fri, 11 Nov 2005 13:58:16 -0800


Added flag  -debug-runtime {false|true}  for linking with libmlton-gdb.a
without adding debug info to the generated .o files.


----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun	2005-11-11 21:42:01 UTC (rev 4198)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun	2005-11-11 21:58:14 UTC (rev 4199)
@@ -51,6 +51,7 @@
 val buildConstants: bool ref = ref false
 val ccOpts: {opt: string, pred: OptPred.t} list ref = ref []
 val coalesce: int option ref = ref NONE
+val debugRuntime: bool ref = ref false
 val expert: bool ref = ref false
 val explicitAlign: Control.align option ref = ref NONE
 val explicitCodegen: Control.codegen option ref = ref NONE
@@ -178,7 +179,10 @@
         "contify functions into main",
         boolRef contifyIntoMain),
        (Expert, "debug", " {false|true}", "produce executable with debug info",
-        boolRef debug),
+        Bool (fn b => (debug := b
+                       ; debugRuntime := b))),
+       (Expert, "debug-runtime", " {false|true}", "produce executable with debug info",
+        boolRef debugRuntime),
        let
           val flag = "default-ann"
        in
@@ -578,7 +582,7 @@
       val ccOpts = addTargetOpts ccOpts
       val linkOpts =
          List.concat [[concat ["-L", !libTargetDir],
-                       if !debug then "-lmlton-gdb" else "-lmlton"],
+                       if !debugRuntime then "-lmlton-gdb" else "-lmlton"],
                       addTargetOpts linkOpts]
       (* With gcc 3.4, the '-b <arch>' must be the first argument. *)
       val targetOpts =