DebugView.st
changeset 13197 74bdfa87c71d
parent 13162 e19746a3bf73
child 13210 214639c7834e
equal deleted inserted replaced
13196:03021754d821 13197:74bdfa87c71d
  3303             ((ObjectMemory addressOf:steppedContext) printStringRadix:16) print. ' ' print.
  3303             ((ObjectMemory addressOf:steppedContext) printStringRadix:16) print. ' ' print.
  3304         ].
  3304         ].
  3305         steppedContext printCR.
  3305         steppedContext printCR.
  3306     ].
  3306     ].
  3307 
  3307 
  3308     "/ kludge an bug-workaround;
  3308     "/ when single stepping, ignore breakpoints
  3309     "/ I should not see those ...
  3309     here selector == #break ifTrue:[
       
  3310         (here receiver isKindOf:Breakpoint) ifTrue:[
       
  3311             false "here receiver isEnabled" ifFalse:[
       
  3312                 con := nil.
       
  3313                 where := nil. here := nil.
       
  3314                 StepInterruptPending := 1.
       
  3315                 InterruptPending := 1.
       
  3316                 InStepInterrupt := nil.
       
  3317                 ^ self
       
  3318             ]
       
  3319         ].
       
  3320     ].
       
  3321 
       
  3322     "/ kludge: a bug-workaround;
       
  3323     "/ I should not see those...
  3310 
  3324 
  3311     here selector == #ioInterrupt ifTrue:[
  3325     here selector == #ioInterrupt ifTrue:[
  3312         DebuggingDebugger2 == true ifTrue:[
  3326         DebuggingDebugger2 == true ifTrue:[
  3313             'oops - should not get that one' printCR.
  3327             'oops - should not get that one' printCR.
  3314         ].
  3328         ].
  3538         where home notNil ifTrue:[
  3552         where home notNil ifTrue:[
  3539             "/
  3553             "/
  3540             "/ in a block called by 'our' context ?
  3554             "/ in a block called by 'our' context ?
  3541             "/
  3555             "/
  3542             where home == steppedContext ifTrue:[
  3556             where home == steppedContext ifTrue:[
  3543 "/ '*block*' printCR.
  3557                 "/ '*block*' printCR.
  3544                 inBlock := true
  3558                 inBlock := true
  3545             ]
  3559             ]
  3546         ].
  3560         ].
  3547 
  3561 
  3548         where == steppedContext ifFalse:[
  3562         where == steppedContext ifFalse:[
  3549             where := where sender.
  3563             where := where sender.
  3550 
  3564 
  3551             where notNil ifTrue:[
  3565             where notNil ifTrue:[
  3552                 where home == steppedContext ifTrue:[
  3566                 where home == steppedContext ifTrue:[
  3553 "/ '*block*' printCR.
  3567                     "/ '*block*' printCR.
  3554                     inBlock := true.
  3568                     inBlock := true.
  3555                 ]
  3569                 ]
  3556             ].
  3570             ].
  3557 
  3571 
  3558 "/ 'looking for ' print.
  3572 "/ 'looking for ' print.
  3574                         "/ if either the receiver or any arg of this context
  3588                         "/ if either the receiver or any arg of this context
  3575                         "/ is a block of the steppedContext, we must really
  3589                         "/ is a block of the steppedContext, we must really
  3576                         "/ do a single step. Otherwise, stepping through a
  3590                         "/ do a single step. Otherwise, stepping through a
  3577                         "/ do:-loop would be very difficult.
  3591                         "/ do:-loop would be very difficult.
  3578                         receiver := where receiver.
  3592                         receiver := where receiver.
       
  3593 where selector == #critical: ifTrue:[
       
  3594 anyStepBlocks := true.
       
  3595 ] ifFalse:[
  3579                         (receiver isBlock
  3596                         (receiver isBlock
  3580                         and:[(receiver isKindOf:Block)
  3597                         and:[(receiver isKindOf:Block)
  3581                         and:[receiver home == steppedContext]])
  3598                         and:[receiver homeMethod == steppedContext method
       
  3599                              "receiver home == steppedContext"]])
  3582                         ifTrue:[
  3600                         ifTrue:[
  3583                             anyStepBlocks := true.
  3601                             anyStepBlocks := true.
  3584                         ] ifFalse:[
  3602                         ] ifFalse:[
  3585                             where args do:[:arg |
  3603                             where args do:[:arg |
  3586                                 (arg isBlock
  3604                                 (arg isBlock
  3587                                 and:[(arg isKindOf:Block)
  3605                                 and:[(arg isKindOf:Block)
  3588                                 and:[arg home == steppedContext]])
  3606                                 and:[arg homeMethod == steppedContext method
       
  3607                                      "arg home == steppedContext"]])
  3589                                 ifTrue:[
  3608                                 ifTrue:[
  3590                                     anyStepBlocks := true.
  3609                                     anyStepBlocks := true.
  3591                                 ]
  3610                                 ] ifFalse:[
       
  3611                                     (where methodHome receiver isBlock
       
  3612                                     and:[(where methodHome receiver isKindOf:Block)
       
  3613                                     and:[where methodHome receiver homeMethod == steppedContext method
       
  3614                                          "where methodHome receiver home == steppedContext"]])
       
  3615                                     ifTrue:[
       
  3616                                         anyStepBlocks := true.
       
  3617                                     ]
       
  3618                                 ].
  3592                             ]
  3619                             ]
  3593                         ].
  3620                         ].
  3594 
  3621 ].
  3595                         DebuggingDebugger2 == true ifTrue:[
  3622                         DebuggingDebugger2 == true ifTrue:[
  3596                             ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print.
  3623                             ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print.
  3597                             where selector printCR.
  3624                             where selector printCR.
  3598                         ].
  3625                         ].
  3599 
  3626 
  3761         ].
  3788         ].
  3762         oneMore := true
  3789         oneMore := true
  3763     ].
  3790     ].
  3764 
  3791 
  3765     inBlock ifTrue:[
  3792     inBlock ifTrue:[
  3766 "/ 'inBlock' printCR.
  3793         DebuggingDebugger2 == true ifTrue:[
       
  3794             'inBlock' printCR.
       
  3795         ].
  3767         s := 'in block'.
  3796         s := 'in block'.
  3768     ].
  3797     ].
  3769     inBlockBelow ifTrue:[
  3798     inBlockBelow ifTrue:[
       
  3799         DebuggingDebugger2 == true ifTrue:[
       
  3800             'inBlockBelow' printCR.
       
  3801         ].
  3770         ignore := true
  3802         ignore := true
  3771     ].
  3803     ].
  3772 
  3804 
  3773     DebuggingDebugger2 == true ifTrue:[
  3805     DebuggingDebugger2 == true ifTrue:[
  3774         where notNil ifTrue:[
  3806         where notNil ifTrue:[
  4701     self doStep:-1
  4733     self doStep:-1
  4702 
  4734 
  4703     "Modified: 7.3.1997 / 18:46:49 / cg"
  4735     "Modified: 7.3.1997 / 18:46:49 / cg"
  4704 !
  4736 !
  4705 
  4737 
  4706 doStep:lineNr
  4738 doStep:lineNrOrNilOrMinus1
  4707     "common helper for step, skip & next.
  4739     "common helper for step, skip & next.
  4708      Arrange for single-steppping until we pass lineNr (if nonNil)
  4740      Arrange for single-steppping until we pass lineNr (if nonNil)
  4709      or to next line (if nil) or to next send (if -1)"
  4741      or to next line (if nil) or to next send (if -1)"
  4710 
  4742 
  4711     |con method|
  4743     |con method|
  4726         ] ifFalse:[
  4758         ] ifFalse:[
  4727             con := contextArray at:2.
  4759             con := contextArray at:2.
  4728             steppedContextLineno := con lineNumber.
  4760             steppedContextLineno := con lineNumber.
  4729         ].
  4761         ].
  4730 
  4762 
  4731         skipLineNr := lineNr.
  4763         skipLineNr := lineNrOrNilOrMinus1.
  4732 
  4764 
  4733         lineNr == -1 ifTrue:[
  4765         lineNrOrNilOrMinus1 == -1 ifTrue:[
  4734             steppedContextLineno := skipLineNr := nil.
  4766             steppedContextLineno := skipLineNr := nil.
  4735         ].
  4767         ].
  4736 
  4768 
  4737         (stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[
  4769         (stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[
  4738             steppedContext := contextArray at:1.
  4770             steppedContext := contextArray at:1.
  4742                 steppedContext := con home.
  4774                 steppedContext := con home.
  4743             ] ifFalse:[
  4775             ] ifFalse:[
  4744                 steppedContext := con.
  4776                 steppedContext := con.
  4745             ].
  4777             ].
  4746         ].
  4778         ].
       
  4779 
  4747         wrapperContext := nil.
  4780         wrapperContext := nil.
  4748 
  4781 
  4749 "/ ' step con:' print. (ObjectMemory addressOf:steppedContext) printHex. ' ' print. steppedContext printCR.
  4782 "/ ' step con:' print. (ObjectMemory addressOf:steppedContext) printHex. ' ' print. steppedContext printCR.
  4750 
  4783 
  4751         "
  4784         "
  4759         and:[method isWrapped
  4792         and:[method isWrapped
  4760         and:[method originalMethod ~~ method]]) ifTrue:[
  4793         and:[method originalMethod ~~ method]]) ifTrue:[
  4761             inWrap := true
  4794             inWrap := true
  4762         ].
  4795         ].
  4763 
  4796 
  4764         lineNr == #return ifTrue:[
  4797         lineNrOrNilOrMinus1 == #return ifTrue:[
  4765             Processor activeProcess forceInterruptOnReturnOf:con.
  4798             Processor activeProcess forceInterruptOnReturnOf:con.
  4766         ].
  4799         ].
  4767 
  4800 
  4768         con := nil.
  4801         con := nil.
  4769         bigStep := true.
  4802         bigStep := true.
  8527 ! !
  8560 ! !
  8528 
  8561 
  8529 !DebugView class methodsFor:'documentation'!
  8562 !DebugView class methodsFor:'documentation'!
  8530 
  8563 
  8531 version
  8564 version
  8532     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.600 2013-07-13 20:39:12 cg Exp $'
  8565     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.601 2013-07-22 09:38:33 cg Exp $'
  8533 !
  8566 !
  8534 
  8567 
  8535 version_CVS
  8568 version_CVS
  8536     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.600 2013-07-13 20:39:12 cg Exp $'
  8569     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.601 2013-07-22 09:38:33 cg Exp $'
  8537 !
  8570 !
  8538 
  8571 
  8539 version_SVN
  8572 version_SVN
  8540     ^ '$Id: DebugView.st,v 1.600 2013-07-13 20:39:12 cg Exp $'
  8573     ^ '$Id: DebugView.st,v 1.601 2013-07-22 09:38:33 cg Exp $'
  8541 ! !
  8574 ! !
  8542 
  8575 
  8543 
  8576 
  8544 DebugView initialize!
  8577 DebugView initialize!