Apply patch #5561. Connect debugger on error.
[pspp-builds.git] / src / ui / terminal / main.c
index a99f580d8e613ba987d98f803a2bd3c7530b804d..5e9a605bc4aaef361f8c28d2940c4d4770eb7ede 100644 (file)
@@ -22,6 +22,7 @@
 #include <signal.h>
 #include <stdio.h>
 
+#include <ui/debugger.h>
 #include "command-line.h"
 #include "msg-ui.h"
 #include "progname.h"
@@ -108,7 +109,7 @@ main (int argc, char **argv)
         {
           int result = cmd_parse (the_lexer, the_dataset, 
                                  proc_has_source (the_dataset)
-                                  ? CMD_STATE_DATA : CMD_STATE_INITIAL);
+                                 ? CMD_STATE_DATA : CMD_STATE_INITIAL);
           if (result == CMD_EOF || result == CMD_FINISH)
             break;
           if (result == CMD_CASCADING_FAILURE && !getl_is_interactive ())
@@ -153,6 +154,9 @@ fpu_init (void)
 void 
 bug_handler(int sig)
 {
+#if DEBUGGING
+  connect_debugger ();
+#endif
   switch (sig) 
     {
     case SIGABRT: