DebugView.st
changeset 554 0f8303e1fdfd
parent 545 99d0cac830ef
child 563 93633e3ff304
equal deleted inserted replaced
553:b67caadfe334 554:0f8303e1fdfd
  1054 
  1054 
  1055     "/
  1055     "/
  1056     "/ should no longer happen
  1056     "/ should no longer happen
  1057     "/
  1057     "/
  1058     stepForReturn == true ifTrue:[
  1058     stepForReturn == true ifTrue:[
  1059 	self enter:thisContext sender.
  1059         self enter:thisContext sender.
  1060 	^ self
  1060         ^ self
  1061     ].
  1061     ].
  1062 
  1062 
  1063     Processor activeProcess ~~ inspectedProcess ifTrue:[
  1063     Processor activeProcess ~~ inspectedProcess ifTrue:[
  1064 	'stray step interrupt' errorPrintNL.
  1064         'stray step interrupt' errorPrintNL.
  1065 	^ self
  1065         ^ self
  1066     ].
  1066     ].
  1067 
  1067 
  1068     "
  1068     "
  1069      kludge to hide breakpoint wrappers in the context list: 
  1069      kludge to hide breakpoint wrappers in the context list: 
  1070 	 check if we are in a wrapper methods hidden setup-sequence
  1070          check if we are in a wrapper methods hidden setup-sequence
  1071 	 if so, ignore the interrupt and continue single sending
  1071          if so, ignore the interrupt and continue single sending
  1072     "
  1072     "
  1073     here := thisContext.        "stepInterrupt"
  1073     here := thisContext.        "stepInterrupt"
  1074     here := here sender.        "the interrupted context"  
  1074     here := here sender.        "the interrupted context"  
  1075 
  1075 
  1076 "/ '*******' printNL.
  1076 "/ '*******' printNL.
  1080     where := here.
  1080     where := here.
  1081     isWrap := false.
  1081     isWrap := false.
  1082     left := false.
  1082     left := false.
  1083 
  1083 
  1084     inWrap ifTrue:[
  1084     inWrap ifTrue:[
  1085 	wrappedMethod := nil.
  1085         wrappedMethod := nil.
  1086 	5 timesRepeat:[
  1086         5 timesRepeat:[
  1087 "/ where selector printNL.
  1087 "/ where selector printNL.
  1088 	    (where notNil and:[where isBlockContext not]) ifTrue:[
  1088             (where notNil and:[where isBlockContext not]) ifTrue:[
  1089 		method := where method.
  1089                 method := where method.
  1090 		(method notNil and:[method isWrapped]) ifTrue:[
  1090                 (method notNil and:[method isWrapped]) ifTrue:[
  1091 		    "
  1091                     "
  1092 		     in a wrapper method
  1092                      in a wrapper method
  1093 		    "
  1093                     "
  1094 		    wrappedMethod ~~ method ifTrue:[
  1094                     wrappedMethod ~~ method ifTrue:[
  1095 			wrappedMethod := method.
  1095                         wrappedMethod := method.
  1096 			lastWrappedConAddr := ObjectMemory addressOf:where.
  1096                         lastWrappedConAddr := ObjectMemory addressOf:where.
  1097 			where sender receiver == method originalMethod ifFalse:[
  1097                         where sender receiver == method originalMethod ifFalse:[
  1098 			    isWrap := true.
  1098                             isWrap := true.
  1099 			]
  1099                         ]
  1100 		    ] ifFalse:[
  1100                     ] ifFalse:[
  1101 			(ObjectMemory addressOf:where) == steppedContextAddress ifTrue:[
  1101                         (ObjectMemory addressOf:where) == steppedContextAddress ifTrue:[
  1102 "/ 'change stepCon from: ' print.
  1102 "/ 'change stepCon from: ' print.
  1103 "/ (steppedContextAddress printStringRadix:16)print.
  1103 "/ (steppedContextAddress printStringRadix:16)print.
  1104 "/ ' to: ' print.
  1104 "/ ' to: ' print.
  1105 "/ (lastWrappedConAddr printStringRadix:16)printNL.
  1105 "/ (lastWrappedConAddr printStringRadix:16)printNL.
  1106 
  1106 
  1107 			    inWrap := false.
  1107                             inWrap := false.
  1108 			    steppedContextAddress := lastWrappedConAddr
  1108                             steppedContextAddress := lastWrappedConAddr
  1109 			]
  1109                         ]
  1110 		    ]
  1110                     ]
  1111 		].
  1111                 ].
  1112 		where := where sender
  1112                 where := where sender
  1113 	    ]
  1113             ]
  1114 	].
  1114         ].
  1115     ].
  1115     ].
  1116 
  1116 
  1117     isWrap ifTrue:[
  1117     isWrap ifTrue:[
  1118 "/ 'ignore wrap' printNL.
  1118 "/ 'ignore wrap' printNL.
  1119 "/ ' ' printNL.
  1119 "/ ' ' printNL.
  1120 	"
  1120         "
  1121 	  ignore, while in wrappers hidden setup
  1121           ignore, while in wrappers hidden setup
  1122 	"
  1122         "
  1123 	where := nil. here := nil.
  1123         where := nil. here := nil.
  1124 	ObjectMemory flushInlineCaches.
  1124         ObjectMemory flushInlineCaches.
  1125 	StepInterruptPending := 1.
  1125         StepInterruptPending := 1.
  1126 	InterruptPending := 1.
  1126         InterruptPending := 1.
  1127 	InStepInterrupt := nil.
  1127         InStepInterrupt := nil.
  1128 	^ nil
  1128         ^ nil
  1129     ].
  1129     ].
  1130 
  1130 
  1131     inBlock := false.
  1131     inBlock := false.
  1132 
  1132 
  1133     "
  1133     "
  1134      is this for a send or a step/next ?
  1134      is this for a send or a step/next ?
  1135     "
  1135     "
  1136     bigStep ifTrue:[
  1136     bigStep ifTrue:[
  1137 	"
  1137         "
  1138 	 a step or next - ignore all contexts below the interesting one
  1138          a step or next - ignore all contexts below the interesting one
  1139 	"
  1139         "
  1140 	where := here.      "the interrupted context"
  1140         where := here.      "the interrupted context"
  1141 
  1141 
  1142 	where home notNil ifTrue:[
  1142         where home notNil ifTrue:[
  1143 	    "/
  1143             "/
  1144 	    "/ in a block called by 'our' context ?
  1144             "/ in a block called by 'our' context ?
  1145 	    "/
  1145             "/
  1146 	    (ObjectMemory addressOf:where home) == steppedContextAddress ifTrue:[
  1146             (ObjectMemory addressOf:where home) == steppedContextAddress ifTrue:[
  1147 "/ '*block*' printNL.
  1147 "/ '*block*' printNL.
  1148 		inBlock := true
  1148                 inBlock := true
  1149 	    ]
  1149             ]
  1150 	].
  1150         ].
  1151 
  1151 
  1152 	(ObjectMemory addressOf:where) == steppedContextAddress ifFalse:[
  1152         (ObjectMemory addressOf:where) == steppedContextAddress ifFalse:[
  1153 	    where := where sender.
  1153             where := where sender.
  1154 
  1154 
  1155 	    where home notNil ifTrue:[
  1155             where home notNil ifTrue:[
  1156 		(ObjectMemory addressOf:where home) == steppedContextAddress ifTrue:[
  1156                 (ObjectMemory addressOf:where home) == steppedContextAddress ifTrue:[
  1157 "/ '*block*' printNL.
  1157 "/ '*block*' printNL.
  1158 		    inBlock := true.
  1158                     inBlock := true.
  1159 		]
  1159                 ]
  1160 	    ].
  1160             ].
  1161 
  1161 
  1162 "/ 'looking for ' print.
  1162 "/ 'looking for ' print.
  1163 "/  (steppedContextAddress printStringRadix:16)print. '' printNL.
  1163 "/  (steppedContextAddress printStringRadix:16)print. '' printNL.
  1164 
  1164 
  1165 	    (ObjectMemory addressOf:where) == steppedContextAddress ifFalse:[
  1165             (ObjectMemory addressOf:where) == steppedContextAddress ifFalse:[
  1166 		"
  1166                 "
  1167 		 check if we are in a context below steppedContext
  1167                  check if we are in a context below steppedContext
  1168 		 (i.e. if steppedContext can be reached from
  1168                  (i.e. if steppedContext can be reached from
  1169 		  interrupted context. Not using context-ref but its
  1169                   interrupted context. Not using context-ref but its
  1170 		  address to avoid creation of many useless contexts.)
  1170                   address to avoid creation of many useless contexts.)
  1171 		"
  1171                 "
  1172 		inBlock ifFalse:[
  1172                 inBlock ifFalse:[
  1173 		    [where notNil] whileTrue:[
  1173                     [where notNil] whileTrue:[
  1174 "/  ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print.
  1174 "/  ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print.
  1175 "/  where selector printNL.
  1175 "/  where selector printNL.
  1176 			(ObjectMemory addressOf:where) == steppedContextAddress ifTrue:[
  1176                         (ObjectMemory addressOf:where) == steppedContextAddress ifTrue:[
  1177 "/ 'found it - below; ignore' printNL.
  1177 "/ 'found it - below; ignore' printNL.
  1178 			    "
  1178                             "
  1179 			     found the interesting context somwehere up in the
  1179                              found the interesting context somwehere up in the
  1180 			     chain. We seem to be still below the interesting one ...
  1180                              chain. We seem to be still below the interesting one ...
  1181 			    "
  1181                             "
  1182 			    tracing == true ifTrue:[
  1182                             tracing == true ifTrue:[
  1183 				here printString printNewline
  1183                                 here printString printCR
  1184 			    ].
  1184                             ].
  1185 			    where := nil. here := nil.
  1185                             where := nil. here := nil.
  1186 			    "
  1186                             "
  1187 			      yes, a context below
  1187                               yes, a context below
  1188 			      - continue and schedule another stepInterrupt.
  1188                               - continue and schedule another stepInterrupt.
  1189 			      Must flush caches since optimized methods not always
  1189                               Must flush caches since optimized methods not always
  1190 			      look for pending interrupts
  1190                               look for pending interrupts
  1191 			    "
  1191                             "
  1192 			    ObjectMemory flushInlineCaches.
  1192                             ObjectMemory flushInlineCaches.
  1193 			    StepInterruptPending := 1.
  1193                             StepInterruptPending := 1.
  1194 			    InterruptPending := 1.
  1194                             InterruptPending := 1.
  1195 			    InStepInterrupt := nil.
  1195                             InStepInterrupt := nil.
  1196 			    ^ nil
  1196                             ^ nil
  1197 			].
  1197                         ].
  1198 			where := where sender
  1198                         where := where sender
  1199 		    ].
  1199                     ].
  1200 		    s := 'left stepped method'.
  1200                     s := 'left stepped method'.
  1201 		    left := true.
  1201                     left := true.
  1202 		].
  1202                 ].
  1203 	    ] ifTrue:[
  1203             ] ifTrue:[
  1204 "/ 'found it right in sender' printNL.
  1204 "/ 'found it right in sender' printNL.
  1205 		s := 'after step'
  1205                 s := 'after step'
  1206 	    ].
  1206             ].
  1207 	] ifTrue:[
  1207         ] ifTrue:[
  1208 "/ 'found it right away' printNL.
  1208 "/ 'found it right away' printNL.
  1209 	    s := 'after step'
  1209             s := 'after step'
  1210 	].
  1210         ].
  1211     ] ifFalse:[
  1211     ] ifFalse:[
  1212 "/ ' send' printNL.
  1212 "/ ' send' printNL.
  1213 	"
  1213         "
  1214 	 a send
  1214          a send
  1215 	"
  1215         "
  1216 	steppedContextAddress := nil.
  1216         steppedContextAddress := nil.
  1217 	s := 'after send'
  1217         s := 'after send'
  1218     ].
  1218     ].
  1219 
  1219 
  1220     inBlock ifTrue:[
  1220     inBlock ifTrue:[
  1221 "/ 'inBlock' printNL.
  1221 "/ 'inBlock' printNL.
  1222 	s := 'in block'.
  1222         s := 'in block'.
  1223     ].
  1223     ].
  1224 
  1224 
  1225 "/    where notNil ifTrue:[
  1225 "/    where notNil ifTrue:[
  1226 "/        '(' print. steppedContextLineno print. ') ' print.
  1226 "/        '(' print. steppedContextLineno print. ') ' print.
  1227 "/        where print.
  1227 "/        where print.
  1233     (bigStep 
  1233     (bigStep 
  1234     and:[steppedContextLineno notNil 
  1234     and:[steppedContextLineno notNil 
  1235     and:[where notNil 
  1235     and:[where notNil 
  1236     and:[where lineNumber == steppedContextLineno]]]) ifTrue:[
  1236     and:[where lineNumber == steppedContextLineno]]]) ifTrue:[
  1237 "/ 'same line - ignored' printNL.
  1237 "/ 'same line - ignored' printNL.
  1238 	ignore := true
  1238         ignore := true
  1239     ].
  1239     ].
  1240 
  1240 
  1241     (left not 
  1241     (left not 
  1242     and:[skipLineNr notNil 
  1242     and:[skipLineNr notNil 
  1243     and:[where lineNumber ~~ skipLineNr]]) ifTrue:[
  1243     and:[where lineNumber ~~ skipLineNr]]) ifTrue:[
  1244 "/ 'skip (' print. skipLineNr print. ' unreached - ignored' printNL.
  1244 "/ 'skip (' print. skipLineNr print. ' unreached - ignored' printNL.
  1245 	ignore := true
  1245         ignore := true
  1246     ].
  1246     ].
  1247 
  1247 
  1248     ignore ifTrue:[
  1248     ignore ifTrue:[
  1249 "/' ' printNL.
  1249 "/' ' printNL.
  1250 	where := nil. here := nil.
  1250         where := nil. here := nil.
  1251 	"
  1251         "
  1252 	 yes, a context below
  1252          yes, a context below
  1253 	  - continue and schedule another stepInterrupt.
  1253           - continue and schedule another stepInterrupt.
  1254 	  Must flush caches since optimized methods not always
  1254           Must flush caches since optimized methods not always
  1255 	  look for pending interrupts
  1255           look for pending interrupts
  1256 	"
  1256         "
  1257 	ObjectMemory flushInlineCaches.
  1257         ObjectMemory flushInlineCaches.
  1258 	StepInterruptPending := 1.
  1258         StepInterruptPending := 1.
  1259 	InterruptPending := 1.
  1259         InterruptPending := 1.
  1260 	InStepInterrupt := nil.
  1260         InStepInterrupt := nil.
  1261 	^ nil
  1261         ^ nil
  1262     ].
  1262     ].
  1263 
  1263 
  1264 "/ ' ' printNL.
  1264 "/ ' ' printNL.
  1265 
  1265 
  1266     name := Processor activeProcess nameOrId.
  1266     name := Processor activeProcess nameOrId.
  1271 
  1271 
  1272     "release refs to context"
  1272     "release refs to context"
  1273     where := nil. here := nil.
  1273     where := nil. here := nil.
  1274     self enter:thisContext sender
  1274     self enter:thisContext sender
  1275 
  1275 
  1276     "Modified: 14.12.1995 / 21:46:20 / cg"
  1276     "Modified: 20.5.1996 / 10:27:24 / cg"
  1277 ! !
  1277 ! !
  1278 
  1278 
  1279 !DebugView methodsFor:'menu / button actions'!
  1279 !DebugView methodsFor:'menu / button actions'!
  1280 
  1280 
  1281 autoUpdateOff
  1281 autoUpdateOff
  1318 browse
  1318 browse
  1319     |w cls|
  1319     |w cls|
  1320 
  1320 
  1321     w := selectedContext method who.
  1321     w := selectedContext method who.
  1322     cls := w at:1.
  1322     cls := w at:1.
  1323 cls printNL.
  1323 "/ cls printCR.
  1324     cls browserClass openInClass:cls selector:(w at:2).
  1324     cls browserClass openInClass:cls selector:(w at:2).
  1325 
  1325 
  1326     "Created: 22.11.1995 / 21:27:01 / cg"
  1326     "Created: 22.11.1995 / 21:27:01 / cg"
  1327     "Modified: 3.5.1996 / 13:31:35 / cg"
  1327     "Modified: 20.5.1996 / 10:28:16 / cg"
  1328 !
  1328 !
  1329 
  1329 
  1330 browseClass
  1330 browseClass
  1331     |w cls|
  1331     |w cls|
  1332 
  1332 
  2271                 self doAbort.
  2271                 self doAbort.
  2272             ] ifFalse:[
  2272             ] ifFalse:[
  2273                 self doContinue
  2273                 self doContinue
  2274             ]
  2274             ]
  2275         ].
  2275         ].
  2276         'DEBUGGER: OOPS - non regular debugView closing' infoPrintNL.
  2276         'DEBUGGER: OOPS - non regular debugView closing' infoPrintCR.
  2277         DebugView newDebugger.
  2277         DebugView newDebugger.
  2278     ].
  2278     ].
  2279 
  2279 
  2280     "
  2280     "
  2281      we manually release all private data, since the Debugger
  2281      we manually release all private data, since the Debugger
  2296     grabber := nil.
  2296     grabber := nil.
  2297     self autoUpdateOff.
  2297     self autoUpdateOff.
  2298 
  2298 
  2299     super destroy    "/ 1.12.94
  2299     super destroy    "/ 1.12.94
  2300 
  2300 
  2301     "Modified: 6.3.1996 / 17:43:54 / cg"
  2301     "Modified: 20.5.1996 / 10:31:55 / cg"
  2302 !
  2302 !
  2303 
  2303 
  2304 showSelection:lineNr
  2304 showSelection:lineNr
  2305     "user clicked on a header line - show selected code in textView.
  2305     "user clicked on a header line - show selected code in textView.
  2306      Also sent to autoselect an interesting context on entry."
  2306      Also sent to autoselect an interesting context on entry."
  2538 ! !
  2538 ! !
  2539 
  2539 
  2540 !DebugView class methodsFor:'documentation'!
  2540 !DebugView class methodsFor:'documentation'!
  2541 
  2541 
  2542 version
  2542 version
  2543     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.82 1996-05-16 13:38:23 cg Exp $'
  2543     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.83 1996-05-20 08:40:58 cg Exp $'
  2544 ! !
  2544 ! !