DebugView.st
changeset 448 e50e23ae7dc3
parent 430 45d1b89689a0
child 477 6351acd20dfb
equal deleted inserted replaced
447:7f2888c05b92 448:e50e23ae7dc3
  2032 
  2032 
  2033     "setup a self removing catch-block"
  2033     "setup a self removing catch-block"
  2034     catchBlock := [catchBlock := nil. ^ nil].
  2034     catchBlock := [catchBlock := nil. ^ nil].
  2035 
  2035 
  2036     (exclusive or:[windowGroup isNil]) ifTrue:[
  2036     (exclusive or:[windowGroup isNil]) ifTrue:[
  2037 	"if we do not have multiple processes or its a system process
  2037         "if we do not have multiple processes or its a system process
  2038 	 we start another dispatch loop, which exits when
  2038          we start another dispatch loop, which exits when
  2039 	 either continue, return or step is pressed
  2039          either continue, return or step is pressed
  2040 	 or (via the catchBlock) if an error occurs.
  2040          or (via the catchBlock) if an error occurs.
  2041 	 Since our display is an extra exclusive one, 
  2041          Since our display is an extra exclusive one, 
  2042 	 all processing for normal views stops here ...
  2042          all processing for normal views stops here ...
  2043 	"
  2043         "
  2044 
  2044 
  2045 	WindowGroup setActiveGroup:windowGroup.
  2045         WindowGroup setActiveGroup:windowGroup.
  2046 	SignalSet anySignal handle:[:ex |
  2046         SignalSet anySignal handle:[:ex |
  2047 	    |signal|
  2047             |signal|
  2048 
  2048 
  2049 	    signal := ex signal.
  2049             signal := ex signal.
  2050 	    self showError:'*** Error in modal debugger:
  2050             self showError:'*** Error in modal debugger:
  2051 
  2051 
  2052 >>>> Signal:  ' , signal printString , '
  2052 >>>> Signal:  ' , signal printString , '
  2053 >>>> In:      ' , ex suspendedContext printString , '
  2053 >>>> In:      ' , ex suspendedContext printString , '
  2054 >>>> Message: ' , ex errorString , '
  2054 >>>> Message: ' , ex errorString , '
  2055 
  2055 
  2056 cought & ignored.'.
  2056 cought & ignored.'.
  2057 	    ex return.
  2057             ex return.
  2058 	] do:[
  2058         ] do:[
  2059 	    Object userNotificationSignal handle:[:ex |
  2059             Object userNotificationSignal handle:[:ex |
  2060 		(ex signal == ActivityNotificationSignal) ifTrue:[
  2060                 (ex signal == ActivityNotificationSignal) ifTrue:[
  2061 		    ex proceed
  2061                     ex proceed
  2062 		].
  2062                 ].
  2063 		self showError:ex errorString
  2063                 self showError:ex errorString
  2064 	    ] do:[
  2064             ] do:[
  2065 		device dispatchModalWhile:[haveControl].
  2065                 device dispatchModalWhile:[haveControl].
  2066 	    ]
  2066             ]
  2067 	].
  2067         ].
  2068 	WindowGroup setActiveGroup:nil.
  2068         WindowGroup setActiveGroup:nil.
  2069     ] ifFalse:[
  2069     ] ifFalse:[
  2070 	"we do have multiple processes -
  2070         "we do have multiple processes -
  2071 	 simply enter the DebugViews-Windowgroup event loop.
  2071          simply enter the DebugViews-Windowgroup event loop.
  2072 	 effectively suspending event processing for the currently 
  2072          effectively suspending event processing for the currently 
  2073 	 active group.
  2073          active group.
  2074 	"
  2074         "
  2075 	SignalSet anySignal handle:[:ex |
  2075         SignalSet anySignal handle:[:ex |
  2076 	    |answer signal|
  2076             |answer signal|
  2077 
  2077 
  2078 	    signal := ex signal.
  2078             signal := ex signal.
  2079 
  2079 
  2080 	    "/
  2080             "/
  2081 	    "/ ignore recursive breakpoints
  2081             "/ ignore recursive breakpoints
  2082 	    "/
  2082             "/
  2083 	    signal == MessageTracer breakpointSignal ifTrue:[
  2083             signal == MessageTracer breakpointSignal ifTrue:[
  2084 		'breakpoint in debugger ignored' errorPrintNL.
  2084                 'breakpoint in debugger ignored' errorPrintNL.
  2085 		ex proceed
  2085                 ex proceed
  2086 	    ].
  2086             ].
  2087 	    (signal == ActivityNotificationSignal) ifTrue:[
  2087             (signal == ActivityNotificationSignal) ifTrue:[
  2088 		ex proceed
  2088                 ex proceed
  2089 	    ].
  2089             ].
  2090 	    signal == Exception recursiveExceptionSignal ifTrue:[
  2090             signal == Exception recursiveExceptionSignal ifTrue:[
  2091 		ex parameter signal == MessageTracer breakpointSignal ifTrue:[
  2091                 ex parameter signal == MessageTracer breakpointSignal ifTrue:[
  2092 		    'recursive breakpoint in debugger ignored' errorPrintNL.
  2092                     'recursive breakpoint in debugger ignored' errorPrintNL.
  2093 		    ex proceed.
  2093                     ex proceed.
  2094 		].
  2094                 ].
  2095 
  2095 
  2096 		self showError:'*** Recursive error in debugger:
  2096                 self showError:'*** Recursive error in debugger:
  2097 
  2097 
  2098 >>>> Signal:  ' , ex signal printString , '
  2098 >>>> Signal:  ' , ex signal printString , '
       
  2099 >>>>          ' , ex parameter signal printString , '
  2099 >>>> In:      ' , ex suspendedContext printString , '
  2100 >>>> In:      ' , ex suspendedContext printString , '
  2100 >>>> Message: ' , ex errorString , '
  2101 >>>> Message: ' , ex errorString , '
  2101 
  2102 
  2102 cought & ignored.'.
  2103 cought & ignored.'.
  2103 		ex return
  2104                 ex return
  2104 	    ].
  2105             ].
  2105 
  2106 
  2106 	    self topView raiseDeiconified.    
  2107             self topView raiseDeiconified.    
  2107 
  2108 
  2108 	    answer := Dialog 
  2109             answer := Dialog 
  2109 			choose:('error in debugger: ' , ex errorString , '\\debug again ?') withCRs
  2110                         choose:('error in debugger: ' , ex errorString , '\\debug again ?') withCRs
  2110 			labels:#('debug' 'proceed' 'cancel' ) 
  2111                         labels:#('debug' 'proceed' 'cancel' ) 
  2111 			values:#(#debug #proceed #cancel) 
  2112                         values:#(#debug #proceed #cancel) 
  2112 			default:#cancel.
  2113                         default:#cancel.
  2113 	    answer == #debug ifTrue:[
  2114             answer == #debug ifTrue:[
  2114 		Debugger enterUnconditional:(ex suspendedContext) withMessage:'error in debugger: ' , ex errorString.
  2115                 Debugger enterUnconditional:(ex suspendedContext) withMessage:'error in debugger: ' , ex errorString.
  2115 		ex proceed.
  2116                 ex proceed.
  2116 	    ].
  2117             ].
  2117 	    answer == #proceed ifTrue:[
  2118             answer == #proceed ifTrue:[
  2118 		ex proceed.
  2119                 ex proceed.
  2119 	    ].
  2120             ].
  2120 	    ex return.
  2121             ex return.
  2121 	] do:[
  2122         ] do:[
  2122 	    windowGroup eventLoopWhile:[true] onLeave:[]
  2123             windowGroup eventLoopWhile:[true] onLeave:[]
  2123 	].
  2124         ].
  2124     ].
  2125     ].
  2125     catchBlock := nil.
  2126     catchBlock := nil.
  2126 
  2127 
  2127     "Created: 24.11.1995 / 20:33:45 / cg"
  2128     "Created: 24.11.1995 / 20:33:45 / cg"
  2128     "Modified: 23.1.1996 / 17:27:59 / cg"
  2129     "Modified: 23.3.1996 / 17:17:10 / cg"
  2129 ! !
  2130 ! !
  2130 
  2131 
  2131 !DebugView methodsFor:'user interaction'!
  2132 !DebugView methodsFor:'user interaction'!
  2132 
  2133 
  2133 codeAccept:someCode
  2134 codeAccept:someCode
  2476 ! !
  2477 ! !
  2477 
  2478 
  2478 !DebugView class methodsFor:'documentation'!
  2479 !DebugView class methodsFor:'documentation'!
  2479 
  2480 
  2480 version
  2481 version
  2481     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.71 1996-03-06 17:06:54 cg Exp $'
  2482     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.72 1996-03-23 16:17:34 cg Exp $'
  2482 ! !
  2483 ! !