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. |