#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Thu, 03 Nov 2016 21:48:42 +0100
changeset 20765 7894c699d784
parent 20764 891db338d088
child 20766 7a01da364910
#FEATURE by cg class: Smalltalk changed: #start walkback suppression for -E/-P options
Smalltalk.st
--- a/Smalltalk.st	Thu Nov 03 21:32:59 2016 +0100
+++ b/Smalltalk.st	Thu Nov 03 21:48:42 2016 +0100
@@ -4538,69 +4538,82 @@
                 
                 process := [
                     self providingDisplayDo:[
-                        VerboseStartup == true ifTrue:[
-                            ('Smalltalk [info]: executing expression: "', arg, '".') infoPrintCR.
-                        ].
-                        UserInterrupt handle:[:ex |
-                            Debugging == true ifTrue:[
-                                'user interrupt (type "c" to continue; "x" to exit; "?" for help).' errorPrintCR.
-                                "/ thisContext fullPrintAll.
-                                MiniDebugger enter.
-                                ex proceed.
-                            ].    
-                            self exit:128+(OperatingSystem sigINT).
+                        NoHandlerError handle:[:ex |
+                            Debugging == true ifFalse:[
+                                ObjectMemory debugPrinting ifTrue:[
+                                    ex description lowLevelErrorPrintCR.
+                                    Object infoPrinting ifTrue:[
+                                        ex suspendedContext fullPrintAll.
+                                    ].    
+                                ].
+                                self exit:1
+                            ].
+                            ex reject.
                         ] do:[
-                            isFilter ifTrue:[
-                                "/ --filter - apply code to each input line.
-                                "/ compile code only once
-                                Compiler
-                                    compile:'doIt:line ',arg
-                                    forClass:String
-                                    notifying:(EvalScriptingErrorHandler new source:arg).
-
-                                [Stdin atEnd] whileFalse:[
-                                    |line|
-
-                                    line := Stdin nextLine.
-                                    line doIt:line.
-                                ].
-                            ] ifFalse:[
-                                (isPrint | isEval) ifTrue:[
-                                    "/ --print or --eval
-                                    |rslt|
-
-                                    rslt := Parser new
-                                                evaluate:arg
-                                                notifying:(EvalScriptingErrorHandler new source:arg)
-                                                compile:true.
-                                    isPrint ifTrue:[
-                                        rslt printCR.
+                            VerboseStartup == true ifTrue:[
+                                ('Smalltalk [info]: executing expression: "', arg, '".') infoPrintCR.
+                            ].
+                            UserInterrupt handle:[:ex |
+                                Debugging == true ifTrue:[
+                                    'user interrupt (type "c" to continue; "x" to exit; "?" for help).' errorPrintCR.
+                                    "/ thisContext fullPrintAll.
+                                    MiniDebugger enter.
+                                    ex proceed.
+                                ].    
+                                self exit:128+(OperatingSystem sigINT).
+                            ] do:[
+                                isFilter ifTrue:[
+                                    "/ --filter - apply code to each input line.
+                                    "/ compile code only once
+                                    Compiler
+                                        compile:'doIt:line ',arg
+                                        forClass:String
+                                        notifying:(EvalScriptingErrorHandler new source:arg).
+
+                                    [Stdin atEnd] whileFalse:[
+                                        |line|
+
+                                        line := Stdin nextLine.
+                                        line doIt:line.
                                     ].
                                 ] ifFalse:[
-                                    "/ --run <className>
-                                    |className class|
-
-                                    className := arg.
-                                    class := Smalltalk classNamed:className.
-                                    class isNil ifTrue:[
-                                        StandAlone := true.
-                                        self exitWithErrorMessage:'no such class: "', className, '".'
-                                    ].
-                                    (class respondsTo:#main:) ifTrue:[
-                                        class main:CommandLineArguments.
-                                    ] ifFalse:[    
-                                        (class respondsTo:#main) ifTrue:[
-                                            class main.
+                                    (isPrint | isEval) ifTrue:[
+                                        "/ --print or --eval
+                                        |rslt|
+
+                                        rslt := Parser new
+                                                    evaluate:arg
+                                                    notifying:(EvalScriptingErrorHandler new source:arg)
+                                                    compile:true.
+                                        isPrint ifTrue:[
+                                            rslt printCR.
+                                        ].
+                                    ] ifFalse:[
+                                        "/ --run <className>
+                                        |className class|
+
+                                        className := arg.
+                                        class := Smalltalk classNamed:className.
+                                        class isNil ifTrue:[
+                                            StandAlone := true.
+                                            self exitWithErrorMessage:'no such class: "', className, '".'
+                                        ].
+                                        (class respondsTo:#main:) ifTrue:[
+                                            class main:CommandLineArguments.
                                         ] ifFalse:[    
-                                            (class respondsTo:#start) ifTrue:[
-                                                class start.
+                                            (class respondsTo:#main) ifTrue:[
+                                                class main.
                                             ] ifFalse:[    
-                                                StandAlone := true.
-                                                self exitWithErrorMessage:'class has no "main:", "main" or "start" method.'
+                                                (class respondsTo:#start) ifTrue:[
+                                                    class start.
+                                                ] ifFalse:[    
+                                                    StandAlone := true.
+                                                    self exitWithErrorMessage:'class has no "main:", "main" or "start" method.'
+                                                ].    
                                             ].    
                                         ].    
                                     ].    
-                                ].    
+                                ].
                             ].
                         ].
                     ].