230 This one is the very first entry into the smalltalk world |
230 This one is the very first entry into the smalltalk world |
231 [with error handling, via the initializeSystem], |
231 [with error handling, via the initializeSystem], |
232 right after startup, usually immediately followed by Smalltalk>>start. |
232 right after startup, usually immediately followed by Smalltalk>>start. |
233 |
233 |
234 Notice: |
234 Notice: |
235 this is NOT called when an image is restarted; in this |
235 this is NOT called when an image is restarted; in this |
236 case the show starts in Smalltalk>>restart." |
236 case the show starts in Smalltalk>>restart." |
237 |
237 |
238 Compiler := ByteCodeCompiler. |
238 Compiler := ByteCodeCompiler. |
239 Compiler isNil ifTrue:[ |
239 Compiler isNil ifTrue:[ |
240 " |
240 " |
241 ByteCodeCompiler is not in the system (i.e. has not been linked in) |
241 ByteCodeCompiler is not in the system (i.e. has not been linked in) |
242 this allows at least immediate evaluations for runtime systems without compiler |
242 this allows at least immediate evaluations for runtime systems without compiler |
243 NOTICE: a parser is always needed, otherwise we cannot read resource files etc. |
243 NOTICE: a parser is always needed, otherwise we cannot read resource files etc. |
244 " |
244 " |
245 Compiler := Parser |
245 Compiler := Parser |
246 ]. |
246 ]. |
247 |
247 |
248 "/ |
248 "/ |
249 "/ start catching SIGSEGV and SIGBUS |
249 "/ start catching SIGSEGV and SIGBUS |
250 "/ |
250 "/ |
279 |
279 |
280 "/ |
280 "/ |
281 "/ in case, someone needs the objectFileLoader early |
281 "/ in case, someone needs the objectFileLoader early |
282 "/ |
282 "/ |
283 ObjectFileLoader notNil ifTrue:[ |
283 ObjectFileLoader notNil ifTrue:[ |
284 ObjectFileLoader initialize. |
284 ObjectFileLoader initialize. |
285 ]. |
285 ]. |
286 |
286 |
287 "/ |
287 "/ |
288 "/ now, finally, initialize all other classes |
288 "/ now, finally, initialize all other classes |
289 "/ |
289 "/ |
296 |
296 |
297 "/ just to make sure: if any prefs affect any resources, |
297 "/ just to make sure: if any prefs affect any resources, |
298 "/ flush them here, so they are reread in any case. |
298 "/ flush them here, so they are reread in any case. |
299 "/ required for some apps, for example to show the menu correctly (see launcher's help menu) |
299 "/ required for some apps, for example to show the menu correctly (see launcher's help menu) |
300 ApplicationModel notNil ifTrue:[ |
300 ApplicationModel notNil ifTrue:[ |
301 ApplicationModel flushAllClassResources. |
301 ApplicationModel flushAllClassResources. |
302 ]. |
302 ]. |
303 |
303 |
304 "/ |
304 "/ |
305 "/ give classes a chance to perform 2nd-level initialization |
305 "/ give classes a chance to perform 2nd-level initialization |
306 "/ now, we are certain, that all other classes have been initialized |
306 "/ now, we are certain, that all other classes have been initialized |
601 This one is the very first entry into the smalltalk world, |
601 This one is the very first entry into the smalltalk world, |
602 right after startup, usually immediately followed by Smalltalk>>start. |
602 right after startup, usually immediately followed by Smalltalk>>start. |
603 Here, a few specific initializations are done, then the actual initialization is |
603 Here, a few specific initializations are done, then the actual initialization is |
604 done inside an error handler in basicInitializeSystem. |
604 done inside an error handler in basicInitializeSystem. |
605 Notice: |
605 Notice: |
606 this is NOT called when an image is restarted; |
606 this is NOT called when an image is restarted; |
607 in this case the show starts in Smalltalk>>restart." |
607 in this case the show starts in Smalltalk>>restart." |
608 |
608 |
609 |idx| |
609 |idx| |
610 |
610 |
611 NumberOfClassesHint := 10000. |
611 NumberOfClassesHint := 10000. |
612 |
612 |
613 Initializing := true. |
613 Initializing := true. |
614 AbstractOperatingSystem initializeConcreteClass. |
614 AbstractOperatingSystem initializeConcreteClass. |
615 |
615 |
616 CommandLineArguments isNil ifTrue:[ |
616 CommandLineArguments isEmptyOrNil ifTrue:[ |
617 CommandLineArguments := #('stx') asOrderedCollection. |
617 CommandLineArguments := #('stx') asOrderedCollection. |
618 ]. |
618 ]. |
619 CommandLine := CommandLineArguments copy. |
619 CommandLine := CommandLineArguments copy. |
620 CommandLineArguments := CommandLineArguments asOrderedCollection. |
620 CommandLineArguments := CommandLineArguments asOrderedCollection. |
621 CommandName := CommandLineArguments removeFirst. "/ the command |
621 CommandName := CommandLineArguments removeFirst. "/ the command |
622 |
622 |
624 VerboseLoading := (CommandLineArguments includes:'--verboseLoading'). |
624 VerboseLoading := (CommandLineArguments includes:'--verboseLoading'). |
625 |
625 |
626 DebuggingStandAlone := false. |
626 DebuggingStandAlone := false. |
627 |
627 |
628 StandAlone ifTrue:[ |
628 StandAlone ifTrue:[ |
629 InfoPrinting := false. |
629 InfoPrinting := false. |
630 ObjectMemory infoPrinting:false. |
630 ObjectMemory infoPrinting:false. |
631 IgnoreAssertions := true. |
631 IgnoreAssertions := true. |
632 |
632 |
633 idx := CommandLineArguments indexOf:'--debug'. |
633 idx := CommandLineArguments indexOf:'--debug'. |
634 idx ~~ 0 ifTrue:[ |
634 idx ~~ 0 ifTrue:[ |
635 DebuggingStandAlone := true. |
635 DebuggingStandAlone := true. |
636 ]. |
636 ]. |
637 DebuggingStandAlone ifTrue:[ |
637 DebuggingStandAlone ifTrue:[ |
638 Inspector := MiniInspector. |
638 Inspector := MiniInspector. |
639 Debugger := MiniDebugger. |
639 Debugger := MiniDebugger. |
640 IgnoreAssertions := false. |
640 IgnoreAssertions := false. |
641 ]. |
641 ]. |
642 ] ifFalse:[ |
642 ] ifFalse:[ |
643 "/ |
643 "/ |
644 "/ define low-level debugging tools - graphical classes are not prepared yet |
644 "/ define low-level debugging tools - graphical classes are not prepared yet |
645 "/ to handle things. |
645 "/ to handle things. |
646 "/ This will bring us into the MiniDebugger when an error occurs during startup. |
646 "/ This will bring us into the MiniDebugger when an error occurs during startup. |
647 "/ |
647 "/ |
648 Inspector := MiniInspector. |
648 Inspector := MiniInspector. |
649 Debugger := MiniDebugger. |
649 Debugger := MiniDebugger. |
650 IgnoreAssertions := false. |
650 IgnoreAssertions := false. |
651 ]. |
651 ]. |
652 |
652 |
653 Error handle:[:ex | |
653 Error handle:[:ex | |
654 StandAlone ifTrue:[ |
654 StandAlone ifTrue:[ |
655 DebuggingStandAlone ifFalse:[ |
655 DebuggingStandAlone ifFalse:[ |
656 'Startup Error - use --debug command line argument for more info' errorPrintCR. |
656 'Startup Error - use --debug command line argument for more info' errorPrintCR. |
657 Smalltalk exit:1. |
657 Smalltalk exit:1. |
658 ]. |
658 ]. |
659 'Startup Error' errorPrintCR. |
659 'Startup Error' errorPrintCR. |
660 thisContext fullPrintAll. |
660 thisContext fullPrintAll. |
661 ]. |
661 ]. |
662 ex reject. |
662 ex reject. |
663 ] do:[ |
663 ] do:[ |
664 self basicInitializeSystem |
664 self basicInitializeSystem |
665 ]. |
665 ]. |
666 |
666 |
667 "Modified: / 12-10-2010 / 11:27:47 / cg" |
667 "Modified: / 12-10-2010 / 11:27:47 / cg" |
668 ! |
668 ! |
669 |
669 |
8221 ! ! |
8221 ! ! |
8222 |
8222 |
8223 !Smalltalk class methodsFor:'documentation'! |
8223 !Smalltalk class methodsFor:'documentation'! |
8224 |
8224 |
8225 version |
8225 version |
8226 ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1124 2015-04-27 14:16:56 cg Exp $' |
8226 ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1125 2015-04-29 11:23:35 cg Exp $' |
8227 ! |
8227 ! |
8228 |
8228 |
8229 version_CVS |
8229 version_CVS |
8230 ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1124 2015-04-27 14:16:56 cg Exp $' |
8230 ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1125 2015-04-29 11:23:35 cg Exp $' |
8231 ! |
8231 ! |
8232 |
8232 |
8233 version_HG |
8233 version_HG |
8234 |
8234 |
8235 ^ '$Changeset: <not expanded> $' |
8235 ^ '$Changeset: <not expanded> $' |
8236 ! |
8236 ! |
8237 |
8237 |
8238 version_SVN |
8238 version_SVN |
8239 ^ '$ Id: Smalltalk.st 10648 2011-06-23 15:55:10Z vranyj1 $' |
8239 ^ '$ Id: Smalltalk.st 10648 2011-06-23 15:55:10Z vranyj1 $' |
8240 ! ! |
8240 ! ! |
8241 |
|