DebugView.st
changeset 803 f8371812c789
parent 801 9aac5620fff5
child 804 7861d5447298
equal deleted inserted replaced
802:da3f109853ba 803:f8371812c789
  1155 !
  1155 !
  1156 
  1156 
  1157 stepOrNext
  1157 stepOrNext
  1158     |where here s isWrap method lastWrappedConAddr wrappedMethod 
  1158     |where here s isWrap method lastWrappedConAddr wrappedMethod 
  1159      inBlock left ignore contextBelow lastWrappedContext
  1159      inBlock left ignore contextBelow lastWrappedContext
  1160      leftWrap enteredWrap|
  1160      leftWrap enteredWrap anyStepBlocks belowSteppedContext|
  1161 
  1161 
  1162     "/ DebuggingDebugger := true
  1162     "/ DebuggingDebugger := true
  1163 
  1163 
  1164     skipLineNr == #return ifTrue:[
  1164     skipLineNr == #return ifTrue:[
  1165         name := Processor activeProcess nameOrId.
  1165         name := Processor activeProcess nameOrId.
  1266         InStepInterrupt := nil.
  1266         InStepInterrupt := nil.
  1267         ^ nil
  1267         ^ nil
  1268     ].
  1268     ].
  1269 
  1269 
  1270     inBlock := false.
  1270     inBlock := false.
       
  1271     anyStepBlocks := false.
  1271 
  1272 
  1272     "/
  1273     "/
  1273     "/ is this for a send or a step/next ?
  1274     "/ is this for a send or a step/next ?
  1274     "/
  1275     "/
  1275     (bigStep 
  1276     (bigStep 
  1305 
  1306 
  1306 "/where print. ' ' print. ((ObjectMemory addressOf:where)printStringRadix:16) printCR.
  1307 "/where print. ' ' print. ((ObjectMemory addressOf:where)printStringRadix:16) printCR.
  1307 "/steppedContext print. ' ' print. ((ObjectMemory addressOf:steppedContext)printStringRadix:16) printCR.
  1308 "/steppedContext print. ' ' print. ((ObjectMemory addressOf:steppedContext)printStringRadix:16) printCR.
  1308 
  1309 
  1309             where == steppedContext ifFalse:[
  1310             where == steppedContext ifFalse:[
  1310                 "
  1311 
  1311                  check if we are in a context below steppedContext
  1312                 "/ check if we are in a context below steppedContext
  1312                  (i.e. if steppedContext can be reached from
  1313                 "/ (i.e. if steppedContext can be reached from
  1313                   interrupted context. Not using context-ref but its
  1314                 "/  interrupted context. Not using context-ref but its
  1314                   address to avoid creation of many useless contexts.)
  1315                 "/  address to avoid creation of many useless contexts.)
  1315                 "
  1316 
  1316                 inBlock ifFalse:[
  1317                 inBlock ifFalse:[
  1317                     [where notNil] whileTrue:[
  1318                     [where notNil] whileTrue:[
       
  1319 
       
  1320                         "/ if either the receiver or any arg of this context
       
  1321                         "/ is a block of the steppedContext, we must really
       
  1322                         "/ do a single step. Otherwise, stepping through a
       
  1323                         "/ do:-loop would be very difficult.
       
  1324 
       
  1325                         (where receiver isBlock
       
  1326                         and:[where receiver home == steppedContext])
       
  1327                         ifTrue:[
       
  1328                             anyStepBlocks := true.
       
  1329                         ] ifFalse:[
       
  1330                             where args do:[:arg |
       
  1331                                 (arg isBlock
       
  1332                                 and:[arg home == steppedContext])
       
  1333                                 ifTrue:[
       
  1334                                     anyStepBlocks := true.
       
  1335                                 ]
       
  1336                             ]
       
  1337                         ].
  1318 
  1338 
  1319                         DebuggingDebugger == true ifTrue:[
  1339                         DebuggingDebugger == true ifTrue:[
  1320                             ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print.
  1340                             ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print.
  1321                             where selector printNL.
  1341                             where selector printNL.
  1322                         ].
  1342                         ].
  1334                               yes, a context below
  1354                               yes, a context below
  1335                               - continue and schedule another stepInterrupt.
  1355                               - continue and schedule another stepInterrupt.
  1336                               Must flush caches since optimized methods not always
  1356                               Must flush caches since optimized methods not always
  1337                               look for pending interrupts
  1357                               look for pending interrupts
  1338                             "
  1358                             "
  1339                             ObjectMemory flushInlineCaches.
  1359 '---' printCR.
  1340                             (contextBelow notNil 
  1360 contextBelow printCR.
  1341                             and:[inBlock not]) ifTrue:[
  1361 inBlock printCR.
       
  1362 
       
  1363                             contextBelow notNil ifTrue:[
  1342 "/ 'prepare for unwind-catch' printNL.
  1364 "/ 'prepare for unwind-catch' printNL.
  1343 "/ 'con= ' print. contextBelow printCR.
  1365 "/ 'con= ' print. contextBelow printCR.
  1344                                 contextBelow selector notNil ifTrue:[
  1366                                 contextBelow selector notNil ifTrue:[
  1345                                     self label:'single stepping - please wait ...(' , contextBelow selector , ')'.
  1367                                     self label:'single stepping - please wait ...(' , contextBelow selector , ')'.
  1346                                 ].
  1368                                 ].
  1350                                     contextBelow printCR.
  1372                                     contextBelow printCR.
  1351                                 ].
  1373                                 ].
  1352                                 Processor activeProcess forceInterruptOnReturnOf:contextBelow.
  1374                                 Processor activeProcess forceInterruptOnReturnOf:contextBelow.
  1353                                 StepInterruptPending := nil.
  1375                                 StepInterruptPending := nil.
  1354                             ] ifFalse:[
  1376                             ] ifFalse:[
       
  1377                                 ObjectMemory flushInlineCaches.
       
  1378 
  1355                                 here selector notNil ifTrue:[
  1379                                 here selector notNil ifTrue:[
  1356                                     self label:'single stepping - please wait ...(' , here selector , ')'.
  1380                                     self label:'single stepping - please wait ...(' , here selector , ')'.
  1357                                 ].
  1381                                 ].
  1358 
  1382 
  1359                                 DebuggingDebugger == true ifTrue:[
  1383                                 DebuggingDebugger == true ifTrue:[
  1366                             InStepInterrupt := nil.
  1390                             InStepInterrupt := nil.
  1367 
  1391 
  1368                             ^ nil
  1392                             ^ nil
  1369                         ].
  1393                         ].
  1370 
  1394 
  1371                         where home == steppedContext ifTrue:[
  1395                         where methodHome == steppedContext methodHome ifTrue:[
  1372                             inBlock := true.
  1396                             inBlock := true.
  1373                         ].
  1397                         ].
  1374 
  1398 
  1375                         contextBelow := where.
  1399                         anyStepBlocks ifFalse:[
       
  1400                             inBlock ifFalse:[
       
  1401                                 contextBelow := where
       
  1402                             ]
       
  1403                         ].
  1376                         where := where sender
  1404                         where := where sender
  1377                     ].
  1405                     ].
  1378                     s := 'context returned'.
  1406                     s := 'context returned'.
  1379                     left := true.
  1407                     left := true.
  1380                 ].
  1408                 ].
  1406     left ifTrue:[
  1434     left ifTrue:[
  1407         steppedContext home notNil ifTrue:[
  1435         steppedContext home notNil ifTrue:[
  1408             steppedContext := steppedContext home.
  1436             steppedContext := steppedContext home.
  1409             s := 'after step'.
  1437             s := 'after step'.
  1410             left := false.
  1438             left := false.
       
  1439 "/ DebugView enterUnconditional:thisContext withMessage:'debug'.
       
  1440 
  1411         ]
  1441         ]
  1412     ].
  1442     ].
  1413 
  1443 
  1414     "
  1444     "
  1415      kludge to hide breakpoint wrappers in the context list: 
  1445      kludge to hide breakpoint wrappers in the context list: 
  1553 "/'enter' printCR.
  1583 "/'enter' printCR.
  1554 
  1584 
  1555     self enter:thisContext sender sender
  1585     self enter:thisContext sender sender
  1556 
  1586 
  1557     "Created: 14.10.1996 / 12:53:39 / cg"
  1587     "Created: 14.10.1996 / 12:53:39 / cg"
  1558     "Modified: 23.10.1996 / 01:20:16 / cg"
  1588     "Modified: 23.10.1996 / 19:11:27 / cg"
  1559 ! !
  1589 ! !
  1560 
  1590 
  1561 !DebugView methodsFor:'menu / button actions'!
  1591 !DebugView methodsFor:'menu / button actions'!
  1562 
  1592 
  1563 autoUpdateOff
  1593 autoUpdateOff
  2981 ! !
  3011 ! !
  2982 
  3012 
  2983 !DebugView class methodsFor:'documentation'!
  3013 !DebugView class methodsFor:'documentation'!
  2984 
  3014 
  2985 version
  3015 version
  2986     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.113 1996-10-23 15:35:33 cg Exp $'
  3016     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.114 1996-10-23 18:13:15 cg Exp $'
  2987 ! !
  3017 ! !