DebugView.st
branchjv
changeset 12807 ba8c5416aa28
parent 12682 6fb2176bf0fa
parent 12743 43616af3d027
child 12819 0ce340e972c4
equal deleted inserted replaced
12806:d550d7de8e2d 12807:ba8c5416aa28
  1310     "
  1310     "
  1311      if this is a noHandler exception, skip forward
  1311      if this is a noHandler exception, skip forward
  1312      to the erronous context
  1312      to the erronous context
  1313     "
  1313     "
  1314     ex notNil ifTrue:[
  1314     ex notNil ifTrue:[
  1315         ex signal == Signal noHandlerSignal ifTrue:[
  1315         ex creator == Signal noHandlerSignal ifTrue:[
  1316             found := ex suspendedContext
  1316             found := ex suspendedContext
  1317         ]
  1317         ]
  1318     ].
  1318     ].
  1319 "/ Transcript show:'1 '; showCR:found.
  1319 "/ Transcript show:'1 '; showCR:found.
  1320     found isNil ifTrue:[
  1320     found isNil ifTrue:[
  2020 
  2020 
  2021     "
  2021     "
  2022      have to catch errors occuring in unwind-blocks
  2022      have to catch errors occuring in unwind-blocks
  2023     "
  2023     "
  2024     self cacheMyself.
  2024     self cacheMyself.
       
  2025     con := thisContext sender.
  2025 
  2026 
  2026     Error handle:[:ex |
  2027     Error handle:[:ex |
  2027         'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2028         'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2028         ex description infoPrintCR.
  2029         ex description infoPrintCR.
  2029 
       
  2030         ex proceed
  2030         ex proceed
  2031     ] do:[
  2031     ] do:[
  2032         "/ find the enter:select context.
  2032         "/ find the enter:select context.
  2033         con := thisContext sender.
  2033         [(con selector ~~ #enter:select:) or:[con receiver ~~ self]] whileTrue:[ 
  2034         [
  2034             con := con sender 
  2035             (con selector == #enter:select:)
  2035         ].
  2036             and:[con receiver == self]
       
  2037         ]
       
  2038         whileFalse:[ con := con sender ].
       
  2039 
  2036 
  2040         "/ must skip over its caller (because this one has a ControlInterrupt handler too)
  2037         "/ must skip over its caller (because this one has a ControlInterrupt handler too)
  2041         con sender receiver == self class ifTrue:[
  2038         con sender receiver == self class ifTrue:[
  2042             con := con sender.
  2039             con := con sender.
  2043             con sender receiver == self class ifTrue:[
  2040             con sender receiver == self class ifTrue:[
  2044                 con := con sender.
  2041                 con := con sender methodHome.
  2045                 con isBlockContext ifTrue:[
       
  2046                     con := con methodHome.
       
  2047                 ]
       
  2048             ].
  2042             ].
  2049         ].
  2043         ].
  2050 
  2044 
  2051         con unwindThenDo:aBlock.
  2045         con unwindThenDo:aBlock.
  2052     ].
  2046     ].
  3164 !DebugView methodsFor:'interrupt handling'!
  3158 !DebugView methodsFor:'interrupt handling'!
  3165 
  3159 
  3166 contextInterrupt
  3160 contextInterrupt
  3167     DebuggingDebugger == true ifTrue:[
  3161     DebuggingDebugger == true ifTrue:[
  3168         'contextIRQ' printCR.
  3162         'contextIRQ' printCR.
  3169         thisContext sender fullPrint.
  3163         thisContext methodHome sender fullPrint.
  3170     ].
  3164     ].
  3171     self stepOrNext
  3165     self stepOrNext
  3172 
  3166 
  3173     "Modified: / 30.10.1997 / 21:22:25 / cg"
  3167     "Modified: / 30.10.1997 / 21:22:25 / cg"
  3174 !
  3168 !
  4296         exContext := thisContext findSpecialHandle:false raise:true.
  4290         exContext := thisContext findSpecialHandle:false raise:true.
  4297 
  4291 
  4298         (exContext notNil
  4292         (exContext notNil
  4299         and:[ (ex := exContext receiver) isLazyValue not
  4293         and:[ (ex := exContext receiver) isLazyValue not
  4300         and:[ ex isException
  4294         and:[ ex isException
  4301         and:[ ex signal == NoHandlerError
  4295         and:[ ex creator == NoHandlerError
  4302         and:[ ex parameter signal == RecursionError]]]])
  4296         and:[ ex exception creator == RecursionError]]]])
  4303         ifTrue:[
  4297         ifTrue:[
  4304             "/ debug due to unhandled recursionInterrupt.
  4298             "/ debug due to unhandled recursionInterrupt.
  4305             "/ ask if we should proceed with more stack.
  4299             "/ ask if we should proceed with more stack.
  4306 
  4300 
  4307             answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs.
  4301             answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs.
  4395     ].
  4389     ].
  4396 
  4390 
  4397     "/ code for a setter
  4391     "/ code for a setter
  4398     (selector numArgs == 1
  4392     (selector numArgs == 1
  4399     and:[(selector endsWith:':')
  4393     and:[(selector endsWith:':')
  4400     and:[receiversClass instVarNames includes:(selector copyWithoutLast:1)]])
  4394     and:[receiversClass instVarNames includes:(selector copyButLast:1)]])
  4401     ifTrue:[
  4395     ifTrue:[
  4402         varName := selector copyWithoutLast:1.
  4396         varName := selector copyButLast:1.
  4403         argName := argNames first.
  4397         argName := argNames first.
  4404         code := '%1\' , haltStmtFix , '\    %3 := %4.'.
  4398         code := '%1\' , haltStmtFix , '\    %3 := %4.'.
  4405         cat := 'accessing'.
  4399         cat := 'accessing'.
  4406     ].
  4400     ].
  4407 
  4401 
  6991 
  6985 
  6992         WindowGroup setActiveGroup:windowGroup.
  6986         WindowGroup setActiveGroup:windowGroup.
  6993         SignalSet anySignal handle:[:ex |
  6987         SignalSet anySignal handle:[:ex |
  6994             |signal|
  6988             |signal|
  6995 
  6989 
  6996             signal := ex signal.
  6990             signal := ex creator.
  6997             (UserNotification accepts:signal) ifTrue:[
  6991             (UserNotification accepts:signal) ifTrue:[
  6998 Transcript showCR:'UserNotification'.
  6992 Transcript showCR:'UserNotification'.
  6999                 (signal ~~ ActivityNotificationSignal) ifTrue:[
  6993                 (signal ~~ ActivityNotificationSignal) ifTrue:[
  7000                     self showError:ex description.
  6994                     self showError:ex description.
  7001                 ].
  6995                 ].
  7051          active group.
  7045          active group.
  7052         "
  7046         "
  7053         SignalSet anySignal handle:[:ex |
  7047         SignalSet anySignal handle:[:ex |
  7054             |answer signal eMsg|
  7048             |answer signal eMsg|
  7055 
  7049 
  7056             signal := ex signal.
  7050             signal := ex creator.
  7057 
  7051 
  7058             DebuggingDebugger ~~ true ifTrue:[
  7052             DebuggingDebugger ~~ true ifTrue:[
  7059                 (signal == ActivityNotification) ifTrue:[
  7053                 (signal == ActivityNotification) ifTrue:[
  7060                     ex proceed
  7054                     ex proceed
  7061                 ].
  7055                 ].
  7090                         ex reject
  7084                         ex reject
  7091                     ].
  7085                     ].
  7092                     ex return.
  7086                     ex return.
  7093                 ].
  7087                 ].
  7094                 signal == RecursiveExceptionError ifTrue:[
  7088                 signal == RecursiveExceptionError ifTrue:[
  7095                     (ex parameter signal == BreakPointInterrupt)
  7089                     (ex exception creator == BreakPointInterrupt)
  7096                     ifTrue:[
  7090                     ifTrue:[
  7097                         'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR.
  7091                         'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR.
  7098                         ex proceed.
  7092                         ex proceed.
  7099                     ].
  7093                     ].
  7100 
  7094 
  7101                     self showError:'*** Recursive error in debugger:
  7095                     self showError:'*** Recursive error in debugger:
  7102 
  7096 
  7103 >>>> Signal:  ' , ex signal printString , '
  7097 >>>> Signal:  ' , ex creator printString , '
  7104 >>>>          ' , ex parameter signal printString , '
  7098 >>>>          ' , ex parameter creator printString , '
  7105 >>>> In:      ' , ex suspendedContext printString , '
  7099 >>>> In:      ' , ex suspendedContext printString , '
  7106 >>>> From:    ' , ex suspendedContext sender printString , '
  7100 >>>> From:    ' , ex suspendedContext sender printString , '
  7107 >>>>     :    ' , ex suspendedContext sender sender printString , '
  7101 >>>>     :    ' , ex suspendedContext sender sender printString , '
  7108 >>>>     :    ' , ex suspendedContext sender sender sender printString , '
  7102 >>>>     :    ' , ex suspendedContext sender sender sender printString , '
  7109 >>>>     :    ' , ex suspendedContext sender sender sender sender printString , '
  7103 >>>>     :    ' , ex suspendedContext sender sender sender sender printString , '
  7115             ].
  7109             ].
  7116 
  7110 
  7117             self topView raiseDeiconified.
  7111             self topView raiseDeiconified.
  7118 
  7112 
  7119             eMsg := ex description.
  7113             eMsg := ex description.
  7120             (ex signal isControlInterrupt) ifTrue:[
  7114             (signal isControlInterrupt) ifTrue:[
  7121                 eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString
  7115                 eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString
  7122             ].
  7116             ].
  7123             Dialog aboutToOpenBoxNotificationSignal
  7117             Dialog aboutToOpenBoxNotificationSignal
  7124                 handle:[:ex | ex proceed ]
  7118                 handle:[:ex | ex proceed ]
  7125                 do:[
  7119                 do:[
  7538         do:[
  7532         do:[
  7539             Error 
  7533             Error 
  7540                 handle:[:ex | 
  7534                 handle:[:ex | 
  7541                     |s con|
  7535                     |s con|
  7542 
  7536 
  7543                     ex signal isControlInterrupt ifTrue:[
  7537                     ex creator isControlInterrupt ifTrue:[
  7544                         'DebugView [info]: halt/break ignored - while showing selection in debugger' 
  7538                         'DebugView [info]: halt/break ignored - while showing selection in debugger' 
  7545                             infoPrintCR.
  7539                             infoPrintCR.
  7546                         ex proceed
  7540                         ex proceed
  7547                     ].
  7541                     ].
  7548                     ('DebugView [info]: error at %1 when showing selection in debugger ignored' 
  7542                     ('DebugView [info]: error at %1 when showing selection in debugger ignored' 
  7774 "/ not covered by Error, anyway
  7768 "/ not covered by Error, anyway
  7775 "/                            ex signal == BreakPointInterrupt ifTrue:[
  7769 "/                            ex signal == BreakPointInterrupt ifTrue:[
  7776 "/                                ex proceed.
  7770 "/                                ex proceed.
  7777 "/                            ].
  7771 "/                            ].
  7778                             code := 'error while asking method for its source'.
  7772                             code := 'error while asking method for its source'.
  7779                             code := code , Character cr , ex signal printString.
  7773                             code := code , Character cr , ex creator printString.
  7780                             code := code , Character cr , 'in: ' , ex suspendedContext printString.
  7774                             code := code , Character cr , 'in: ' , ex suspendedContext printString.
  7781 
  7775 
  7782                             canAccept := false.
  7776                             canAccept := false.
  7783                             ex return.
  7777                             ex return.
  7784                         ] do:[
  7778                         ] do:[
  7848 "/ not covered by Error, anyway
  7842 "/ not covered by Error, anyway
  7849 "/                        ex signal isControlInterrupt ifTrue:[
  7843 "/                        ex signal isControlInterrupt ifTrue:[
  7850 "/                            ex proceed.
  7844 "/                            ex proceed.
  7851 "/                        ].
  7845 "/                        ].
  7852                         code := 'error while asking method for its source'.
  7846                         code := 'error while asking method for its source'.
  7853                         code := code , Character cr , ex signal printString.
  7847                         code := code , Character cr , ex creator printString.
  7854                         code := code , Character cr , 'in: ' , ex suspendedContext printString.
  7848                         code := code , Character cr , 'in: ' , ex suspendedContext printString.
  7855 
  7849 
  7856                         canAccept := false.
  7850                         canAccept := false.
  7857                         ex return.
  7851                         ex return.
  7858                     ] do:[
  7852                     ] do:[
  8327 
  8321 
  8328 
  8322 
  8329 !DebugView class methodsFor:'documentation'!
  8323 !DebugView class methodsFor:'documentation'!
  8330 
  8324 
  8331 version
  8325 version
  8332     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.581 2013-04-16 16:20:09 cg Exp $'
  8326     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.584 2013-05-07 13:16:27 stefan Exp $'
  8333 !
  8327 !
  8334 
  8328 
  8335 version_CVS
  8329 version_CVS
  8336     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.581 2013-04-16 16:20:09 cg Exp $'
  8330     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.584 2013-05-07 13:16:27 stefan Exp $'
  8337 !
  8331 !
  8338 
  8332 
  8339 version_HG
  8333 version_HG
  8340 
  8334 
  8341     ^ '$Changeset: <not expanded> $'
  8335     ^ '$Changeset: <not expanded> $'