guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/libguile script.c


From: Marius Vollmer
Subject: guile/guile-core/libguile script.c
Date: Mon, 05 Nov 2001 18:11:51 -0500

CVSROOT:        /cvs
Module name:    guile
Changes by:     Marius Vollmer <address@hidden> 01/11/05 18:11:51

Modified files:
        guile-core/libguile: script.c 

Log message:
        (scm_shell_usage, scm_compile_shell_switches): Prepend
        a call to turn-on-debugging when --debug has been given instead of
        turning it on directly.  Also, handle new `--no-debug' option,
        which might suppress the call to turn-on-debugging.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/script.c.diff?cvsroot=OldCVS&tr1=1.46&tr2=1.47&r1=text&r2=text

Patches:
Index: guile/guile-core/libguile/script.c
diff -u guile/guile-core/libguile/script.c:1.46 
guile/guile-core/libguile/script.c:1.47
--- guile/guile-core/libguile/script.c:1.46     Thu Jul 19 17:08:49 2001
+++ guile/guile-core/libguile/script.c  Mon Nov  5 18:11:50 2001
@@ -384,6 +384,9 @@
            "                 command line arguments\n"
            "  -ds            do -s script at this point\n"
            "  --debug        start with debugging evaluator and backtraces\n"
+           "  --no-debug     start with normal evaluator\n"
+           "                 Default is to enable debugging for interactive\n"
+           "                 use, but not for `-s' and `-c'.\n"
           "  -q             inhibit loading of user init file\n"
            "  --emacs        enable Emacs protocol (experimental)\n"
           "  --use-srfi=LS  load SRFI modules for the SRFIs in LS,\n"
@@ -403,6 +406,7 @@
 SCM_SYMBOL (sym_eval_string, "eval-string");
 SCM_SYMBOL (sym_command_line, "command-line");
 SCM_SYMBOL (sym_begin, "begin");
+SCM_SYMBOL (sym_turn_on_debugging, "turn-on-debugging");
 SCM_SYMBOL (sym_load_user_init, "load-user-init");
 SCM_SYMBOL (sym_top_repl, "top-repl");
 SCM_SYMBOL (sym_quit, "quit");
@@ -433,6 +437,9 @@
   int interactive = 1;         /* Should we go interactive when done? */
   int inhibit_user_init = 0;   /* Don't load user init file */
   int use_emacs_interface = 0;
+  int turn_on_debugging = 0;
+  int dont_turn_on_debugging = 0;
+
   int i;
   char *argv0 = guile;
 
@@ -523,13 +530,17 @@
          tail = scm_cons (scm_cons (sym_load, do_script),
                           tail);
        }
+
+      else if (! strcmp (argv[i], "--debug"))
+       {
+         turn_on_debugging = 1;
+         dont_turn_on_debugging = 0;
+       }
 
-      else if (! strcmp (argv[i], "--debug")) /* debug eval + backtraces */
+      else if (! strcmp (argv[i], "--no-debug"))
        {
-         SCM_DEVAL_P = 1;
-         SCM_BACKTRACE_P = 1;
-         SCM_RECORD_POSITIONS_P = 1;
-         SCM_RESET_DEBUG_MODE;
+         dont_turn_on_debugging = 1;
+         turn_on_debugging = 0;
        }
 
       else if (! strcmp (argv[i], "--emacs")) /* use emacs protocol */ 
@@ -644,10 +655,17 @@
       tail = scm_cons (scm_cons (sym_load_user_init, SCM_EOL), tail);
     }
 
+  /* If debugging was requested, or we are interactive and debugging
+     was not explicitely turned off, turn on debugging. */
+  if (turn_on_debugging || (interactive  && !dont_turn_on_debugging))
+    {
+      tail = scm_cons (scm_cons (sym_turn_on_debugging, SCM_EOL), tail);
+    }
+
   {
     SCM val = scm_cons (sym_begin, tail);
 
-#if 0
+#if 1
     scm_write (val, SCM_UNDEFINED);
     scm_newline (SCM_UNDEFINED);
 #endif



reply via email to

[Prev in Thread] Current Thread [Next in Thread]