17 steppedContextAddress canAbort abortButton terminateButton |
17 steppedContextAddress canAbort abortButton terminateButton |
18 continueButton stepButton nextButton sendButton returnButton |
18 continueButton stepButton nextButton sendButton returnButton |
19 restartButton exclusive inspecting nChainShown inspectedProcess |
19 restartButton exclusive inspecting nChainShown inspectedProcess |
20 updateProcess stopButton updateButton monitorToggle stepping |
20 updateProcess stopButton updateButton monitorToggle stepping |
21 steppedContextLineno stepForReturn actualContext inWrap |
21 steppedContextLineno stepForReturn actualContext inWrap |
22 stackInspector steppedContext wrapperContext' |
22 stackInspector steppedContext wrapperContext verboseBacktrace' |
23 classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail |
23 classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail |
24 DebuggingDebugger' |
24 DebuggingDebugger' |
25 poolDictionaries:'' |
25 poolDictionaries:'' |
26 category:'Interface-Debugger' |
26 category:'Interface-Debugger' |
27 ! |
27 ! |
1127 contextInspector := ContextInspectorView |
1129 contextInspector := ContextInspectorView |
1128 origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
1130 origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
1129 in:hpanel. |
1131 in:hpanel. |
1130 contextInspector label:'context'. |
1132 contextInspector label:'context'. |
1131 |
1133 |
1132 "Modified: 22.10.1996 / 15:50:01 / cg" |
1134 "Modified: 10.1.1997 / 21:05:52 / cg" |
1133 ! |
1135 ! |
1134 |
1136 |
1135 initializeMiddleButtonMenu |
1137 initializeMiddleButtonMenu |
1136 |labels selectors m| |
1138 |labels selectors m| |
1137 |
1139 |
1138 exclusive ifTrue:[ |
1140 exclusive ifTrue:[ |
1139 labels := resources array:#( |
1141 labels := resources array:#( |
1140 'show more' |
1142 'show more' |
|
1143 'show verbose backtrace' |
1141 '-' |
1144 '-' |
1142 'remove breakpoint' |
1145 'remove breakpoint' |
1143 'remove all trace & breakpoints' |
1146 'remove all trace & breakpoints' |
1144 '-' |
1147 '-' |
1145 'copy walkback text' |
1148 'copy walkback text' |
2223 ^ self showError:'** select a context first **' |
2249 ^ self showError:'** select a context first **' |
2224 ]. |
2250 ]. |
2225 SystemBrowser browseAllCallsOn:selectedContext selector. |
2251 SystemBrowser browseAllCallsOn:selectedContext selector. |
2226 ! |
2252 ! |
2227 |
2253 |
|
2254 showDenseBacktrace |
|
2255 verboseBacktrace := false. |
|
2256 contextView middleButtonMenu labelAt:#showDenseBacktrace put:(resources string:'show verbose backtrace'). |
|
2257 contextView middleButtonMenu selectorAt:#showDenseBacktrace put:#showVerboseBacktrace. |
|
2258 self redisplayBacktrace. |
|
2259 |
|
2260 "Created: 10.1.1997 / 21:33:55 / cg" |
|
2261 "Modified: 10.1.1997 / 21:37:21 / cg" |
|
2262 ! |
|
2263 |
2228 showMore |
2264 showMore |
2229 "double number of contexts shown" |
2265 "double number of contexts shown" |
2230 |
2266 |
2231 |oldSelection con| |
|
2232 |
|
2233 contextArray notNil ifTrue:[ |
2267 contextArray notNil ifTrue:[ |
2234 oldSelection := contextView selection. |
|
2235 nChainShown := nChainShown * 2. |
2268 nChainShown := nChainShown * 2. |
2236 con := contextArray at:1. |
2269 self redisplayBacktrace. |
2237 contextArray at:1 put:nil. |
|
2238 self setContext:con. |
|
2239 contextView setSelection:oldSelection. |
|
2240 ] |
2270 ] |
2241 |
2271 |
2242 "Modified: 25.5.1996 / 12:26:55 / cg" |
2272 "Modified: 10.1.1997 / 21:37:04 / cg" |
|
2273 ! |
|
2274 |
|
2275 showVerboseBacktrace |
|
2276 verboseBacktrace := true. |
|
2277 contextView middleButtonMenu labelAt:#showVerboseBacktrace put:(resources string:'dense stack backtrace'). |
|
2278 contextView middleButtonMenu selectorAt:#showVerboseBacktrace put:#showDenseBacktrace. |
|
2279 self redisplayBacktrace. |
|
2280 |
|
2281 "Modified: 10.1.1997 / 21:37:13 / cg" |
2243 ! |
2282 ! |
2244 |
2283 |
2245 skip |
2284 skip |
2246 "skip for cursor line in selected method" |
2285 "skip for cursor line in selected method" |
2247 |
2286 |
2343 ! |
2382 ! |
2344 |
2383 |
2345 setContext:aContext releaseInspectors:releaseInspectors |
2384 setContext:aContext releaseInspectors:releaseInspectors |
2346 "show calling chain from aContext in the walk-back listview" |
2385 "show calling chain from aContext in the walk-back listview" |
2347 |
2386 |
2348 |con text method caller caller2 m count| |
2387 |con text method caller caller2 m count showIt| |
2349 |
2388 |
2350 (contextArray notNil and:[aContext == (contextArray at:1)]) ifTrue:[ |
2389 (contextArray notNil and:[aContext == (contextArray at:1)]) ifTrue:[ |
2351 "no change" |
2390 "no change" |
2352 ^ false |
2391 ^ false |
2353 ]. |
2392 ]. |
2354 |
2393 |
2355 m := contextView middleButtonMenu. |
2394 m := contextView middleButtonMenu. |
2356 m notNil ifTrue:[ |
2395 m notNil ifTrue:[ |
2357 m disable:#showMore. |
2396 m disable:#showMore. |
2358 ]. |
2397 ]. |
2359 |
2398 |
2360 aContext isNil ifTrue:[ |
2399 aContext isNil ifTrue:[ |
2361 text := Array with:'** no context **'. |
2400 text := Array with:'** no context **'. |
2362 contextArray := nil. |
2401 contextArray := nil. |
2363 ] ifFalse:[ |
2402 ] ifFalse:[ |
2364 text := OrderedCollection new:nChainShown. |
2403 text := OrderedCollection new:nChainShown. |
2365 contextArray := OrderedCollection new:nChainShown. |
2404 contextArray := OrderedCollection new:nChainShown. |
2366 con := aContext. |
2405 con := aContext. |
2367 |
2406 |
2368 " |
2407 " |
2369 get them all |
2408 get them all |
2370 " |
2409 " |
2371 count := 0. |
2410 count := 0. |
2372 [con notNil and:[count <= nChainShown]] whileTrue:[ |
2411 [con notNil and:[count <= nChainShown]] whileTrue:[ |
2373 contextArray add:con. count := count + 1. |
2412 (self showingContext:con) ifTrue:[ |
2374 (MoreDebuggingDetail == true) ifTrue:[ |
2413 contextArray add:con. count := count + 1. |
2375 text add:(((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
2414 |
2376 ] ifFalse:[ |
2415 (MoreDebuggingDetail == true) ifTrue:[ |
2377 text add:con printString. |
2416 text add:(((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
2378 ]. |
2417 ] ifFalse:[ |
2379 |
2418 text add:con printString. |
2380 method := con method. |
2419 ]. |
2381 (method notNil and:[method isWrapped]) ifTrue:[ |
2420 ]. |
2382 " |
2421 |
2383 kludge: if its a wrapped method, then hide the wrap-call |
2422 method := con method. |
2384 " |
2423 (method notNil and:[method isWrapped]) ifTrue:[ |
2385 caller := con sender. |
2424 " |
2386 (caller notNil and:[caller receiver == method originalMethod]) ifTrue:[ |
2425 kludge: if its a wrapped method, then hide the wrap-call |
2387 caller2 := caller sender. |
2426 " |
2388 (caller2 notNil and:[caller2 method == method]) ifTrue:[ |
2427 caller := con sender. |
2389 con := caller2 |
2428 (caller notNil and:[caller receiver == method originalMethod]) ifTrue:[ |
2390 ] |
2429 caller2 := caller sender. |
2391 ]. |
2430 (caller2 notNil and:[caller2 method == method]) ifTrue:[ |
2392 caller := caller2 := nil |
2431 con := caller2 |
2393 ]. |
2432 ] |
2394 con := con sender |
2433 ]. |
2395 ]. |
2434 caller := caller2 := nil |
2396 |
2435 ]. |
2397 " |
2436 con := con sender |
2398 did we reach the end ? |
2437 ]. |
2399 " |
2438 |
2400 (con isNil or:[con sender isNil]) ifTrue:[ |
2439 " |
2401 " |
2440 did we reach the end ? |
2402 the very last one is the startup context |
2441 " |
2403 (in main) - it has nil as receiver and nil as selector |
2442 (con isNil or:[con sender isNil]) ifTrue:[ |
2404 " |
2443 " |
2405 contextArray last selector isNil ifTrue:[ |
2444 the very last one is the startup context |
2406 contextArray removeLast. |
2445 (in main) - it has nil as receiver and nil as selector |
2407 text removeLast |
2446 " |
2408 ] |
2447 contextArray last selector isNil ifTrue:[ |
2409 ] ifFalse:[ |
2448 contextArray removeLast. |
2410 m notNil ifTrue:[ |
2449 text removeLast |
2411 m enable:#showMore. |
2450 ] |
2412 text add:(resources string:'*** more walkback follows - click here to see them ***') |
2451 ] ifFalse:[ |
2413 ]. |
2452 m notNil ifTrue:[ |
2414 ]. |
2453 m enable:#showMore. |
|
2454 text add:(resources string:'*** more walkback follows - click here to see them ***') |
|
2455 ]. |
|
2456 ]. |
2415 ]. |
2457 ]. |
2416 |
2458 |
2417 contextView setList:text. |
2459 contextView setList:text. |
2418 releaseInspectors ifTrue:[ |
2460 releaseInspectors ifTrue:[ |
2419 receiverInspector release. |
2461 receiverInspector release. |
2420 contextInspector release. |
2462 contextInspector release. |
2421 ]. |
2463 ]. |
2422 |
2464 |
2423 m notNil ifTrue:[ |
2465 m notNil ifTrue:[ |
2424 m disable:#removeBreakpoint. |
2466 m disable:#removeBreakpoint. |
2425 m disable:#implementors. |
2467 m disable:#implementors. |
2426 m disable:#senders. |
2468 m disable:#senders. |
2427 m disable:#browseClass. |
2469 m disable:#browseClass. |
2428 ]. |
2470 ]. |
2429 ^ true |
2471 ^ true |
2430 |
2472 |
2431 "Created: 14.12.1995 / 19:10:31 / cg" |
2473 "Created: 14.12.1995 / 19:10:31 / cg" |
|
2474 "Modified: 10.1.1997 / 21:01:57 / cg" |
2432 ! |
2475 ! |
2433 |
2476 |
2434 setContextSkippingInterruptContexts:aContext |
2477 setContextSkippingInterruptContexts:aContext |
2435 "show calling chain from aContext in the walk-back listview. |
2478 "show calling chain from aContext in the walk-back listview. |
2436 Ignore any non-interresting interrupt-context." |
2479 Ignore any non-interresting interrupt-context." |
2469 "Modified: 24.11.1995 / 22:07:30 / cg" |
2512 "Modified: 24.11.1995 / 22:07:30 / cg" |
2470 ! |
2513 ! |
2471 |
2514 |
2472 showTerminated |
2515 showTerminated |
2473 self showError:'** the process has terminated **' |
2516 self showError:'** the process has terminated **' |
|
2517 ! |
|
2518 |
|
2519 showingContext:aContext |
|
2520 "return false, if this context is to be skipped" |
|
2521 |
|
2522 |sel rec| |
|
2523 |
|
2524 verboseBacktrace ifTrue:[^ true]. |
|
2525 |
|
2526 rec := aContext receiver. |
|
2527 sel := aContext selector. |
|
2528 |
|
2529 (rec isMemberOf:Block) ifTrue:[ |
|
2530 sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
|
2531 sel == #valueOnUnwindDo: ifTrue:[^ false]. |
|
2532 |
|
2533 sel == #value ifTrue:[^ false]. |
|
2534 sel == #value: ifTrue:[^ false]. |
|
2535 sel == #value:value: ifTrue:[^ false]. |
|
2536 sel == #value:value:value: ifTrue:[^ false]. |
|
2537 sel == #value:value:value:value: ifTrue:[^ false]. |
|
2538 sel == #value:value:value:value:Value: ifTrue:[^ false]. |
|
2539 sel == #value:value:value:value:value:value: ifTrue:[^ false]. |
|
2540 ]. |
|
2541 |
|
2542 "/ aContext isBlockContext ifTrue:[ |
|
2543 "/ sel == #value ifTrue:[^ false]. |
|
2544 "/ sel == #value: ifTrue:[^ false]. |
|
2545 "/ sel == #value:value: ifTrue:[^ false]. |
|
2546 "/ sel == #value:value:value: ifTrue:[^ false]. |
|
2547 "/ sel == #value:value:value:value: ifTrue:[^ false]. |
|
2548 "/ sel == #value:value:value:value:Value: ifTrue:[^ false]. |
|
2549 "/ sel == #value:value:value:value:value:value: ifTrue:[^ false]. |
|
2550 "/ ]. |
|
2551 |
|
2552 ((rec isMemberOf:Signal) |
|
2553 or:[(rec isMemberOf:QuerySignal) |
|
2554 or:[rec isMemberOf:SignalSet]] |
|
2555 ) ifTrue:[ |
|
2556 sel == #handle:do: ifTrue:[^ false]. |
|
2557 ]. |
|
2558 |
|
2559 ^ true. |
|
2560 |
|
2561 "Created: 10.1.1997 / 21:01:39 / cg" |
|
2562 "Modified: 10.1.1997 / 21:11:32 / cg" |
2474 ! |
2563 ! |
2475 |
2564 |
2476 stepping |
2565 stepping |
2477 ^ stepping |
2566 ^ stepping |
2478 ! |
2567 ! |
2886 " |
2975 " |
2887 special: look if this context was created by |
2976 special: look if this context was created by |
2888 valueWithReceiver kind of method invocation; |
2977 valueWithReceiver kind of method invocation; |
2889 if so, grab the method from the sender and show it |
2978 if so, grab the method from the sender and show it |
2890 " |
2979 " |
2891 ((sender := con sender) notNil |
2980 ((sender := homeContext sender) notNil |
2892 and:[(sender selector startsWith:'valueWithReceiver:') |
2981 and:[(sender selector startsWith:'valueWithReceiver:') |
2893 and:[sender receiver isMethod]]) ifTrue:[ |
2982 and:[sender receiver isMethod]]) ifTrue:[ |
2894 method := sender receiver. |
2983 method := sender receiver. |
2895 self sensor shiftDown ifTrue:[ |
2984 self sensor shiftDown ifTrue:[ |
2896 code := method decompiledSource |
2985 code := method decompiledSource |