3445 |
3448 |
3446 "Modified: / 13.1.1998 / 00:24:47 / cg" |
3449 "Modified: / 13.1.1998 / 00:24:47 / cg" |
3447 ! |
3450 ! |
3448 |
3451 |
3449 showDenseBacktrace |
3452 showDenseBacktrace |
|
3453 |m| |
|
3454 |
|
3455 m := contextView middleButtonMenu. |
3450 verboseBacktrace := false. |
3456 verboseBacktrace := false. |
3451 contextView middleButtonMenu labelAt:#showDenseBacktrace put:(resources string:'show verbose backtrace'). |
3457 m labelAt:#showDenseBacktrace put:(resources string:'Show verbose backtrace'). |
3452 contextView middleButtonMenu selectorAt:#showDenseBacktrace put:#showVerboseBacktrace. |
3458 m selectorAt:#showDenseBacktrace put:#showVerboseBacktrace. |
3453 self redisplayBacktrace. |
3459 self redisplayBacktrace. |
3454 |
3460 |
3455 "Created: 10.1.1997 / 21:33:55 / cg" |
3461 "Created: / 10.1.1997 / 21:33:55 / cg" |
3456 "Modified: 10.1.1997 / 21:37:21 / cg" |
3462 "Modified: / 16.11.2001 / 13:47:06 / cg" |
3457 ! |
3463 ! |
3458 |
3464 |
3459 showMore |
3465 showMore |
3460 "double number of contexts shown" |
3466 "double number of contexts shown" |
3461 |
3467 |
3466 |
3472 |
3467 "Modified: 12.1.1997 / 01:24:26 / cg" |
3473 "Modified: 12.1.1997 / 01:24:26 / cg" |
3468 ! |
3474 ! |
3469 |
3475 |
3470 showVerboseBacktrace |
3476 showVerboseBacktrace |
|
3477 |m| |
|
3478 |
3471 verboseBacktrace := true. |
3479 verboseBacktrace := true. |
3472 contextView middleButtonMenu labelAt:#showVerboseBacktrace put:(resources string:'dense stack backtrace'). |
3480 m := contextView middleButtonMenu. |
3473 contextView middleButtonMenu selectorAt:#showVerboseBacktrace put:#showDenseBacktrace. |
3481 m labelAt:#showVerboseBacktrace put:(resources string:'Show dense backtrace'). |
|
3482 m selectorAt:#showVerboseBacktrace put:#showDenseBacktrace. |
3474 self redisplayBacktrace. |
3483 self redisplayBacktrace. |
3475 |
3484 |
3476 "Modified: 10.1.1997 / 21:37:13 / cg" |
3485 "Modified: / 16.11.2001 / 13:46:43 / cg" |
3477 ! |
3486 ! |
3478 |
3487 |
3479 skip |
3488 skip |
3480 "skip for cursor line in selected method" |
3489 "skip for cursor line in selected method" |
3481 |
3490 |
3808 and:[((h selector == #doIt) |
3829 and:[((h selector == #doIt) |
3809 or:[h selector == #doIt:]) |
3830 or:[h selector == #doIt:]) |
3810 and:[h method who isNil]]]) ifTrue:[ |
3831 and:[h method who isNil]]]) ifTrue:[ |
3811 con := con sender. |
3832 con := con sender. |
3812 text removeLast. |
3833 text removeLast. |
3813 text add:(con methodHome printString) |
3834 text add:(con methodHome printString). |
3814 ]. |
3835 ]. |
3815 h := nil. "/ never keep refs to contexts unless you really need them ... |
3836 h := nil. "/ never keep refs to contexts unless you really need them ... |
3816 ]. |
3837 |
3817 |
3838 "/ "/ and also, all lazy loading intermediates |
3818 "/ and also, all lazy loading intermediates |
3839 "/ |
3819 |
3840 "/ (con selector == #noByteCode |
3820 verboseBacktrace ~~ true ifTrue:[ |
3841 "/ and:[con receiver isMethod |
3821 (con selector == #noByteCode |
3842 "/ and:[con receiver isLazyMethod]]) ifTrue:[ |
3822 and:[con receiver isMethod |
3843 "/ contextArray removeLast. |
3823 and:[con receiver isLazyMethod]]) ifTrue:[ |
3844 "/ text removeLast. |
3824 contextArray removeLast. |
3845 "/ con := con sender. |
3825 text removeLast. |
3846 "/ count := count - 1. |
3826 con := con sender. |
3847 "/ ] |
3827 count := count - 1. |
3848 ]. |
3828 ] |
3849 |
3829 ]. |
3850 "/ with dense backtrace, dont show below the doIt |
3830 |
3851 ( verboseBacktrace ~~ true |
3831 con := con sender |
3852 and:[ con selector == #doIt]) ifTrue:[ |
|
3853 con := nil. |
|
3854 ] ifFalse:[ |
|
3855 con := con sender |
|
3856 ] |
3832 ]. |
3857 ]. |
3833 |
3858 |
3834 " |
3859 " |
3835 did we reach the end ? |
3860 did we reach the end ? |
3836 " |
3861 " |
4530 ]. |
4555 ]. |
4531 |
4556 |
4532 "Modified: / 15.11.2001 / 17:07:29 / cg" |
4557 "Modified: / 15.11.2001 / 17:07:29 / cg" |
4533 ! |
4558 ! |
4534 |
4559 |
|
4560 codeAccept:someCode unwind:doUnwind onCancel:cancelAction |
|
4561 "user wants some code to be recompiled - must unwind stack since everything above |
|
4562 and including selected method cannot be continued." |
|
4563 |
|
4564 " |
|
4565 actually, this is not true, since the active methods will still be |
|
4566 executed correctly - however, the code shown in the debugger is no |
|
4567 longer in sync (showing the new code) with the executed code. |
|
4568 Therefore, we hide those contexts to avoid confusion .... |
|
4569 If you dont like this behavior, remove the 'inspecting ifFalse:' check below" |
|
4570 |
|
4571 "walk up context chain and find highest context which is either the selected context, |
|
4572 or - if its a block-context - whose home is the selected context" |
|
4573 |
|
4574 |con top sel implementorClass method newMethod category| |
|
4575 |
|
4576 codeView withWaitCursorDo:[ |
|
4577 " |
|
4578 find the method-home context for this one |
|
4579 " |
|
4580 con := selectedContext. |
|
4581 top := con. |
|
4582 [con notNil] whileTrue:[ |
|
4583 (con methodHome == selectedContext) ifTrue:[ |
|
4584 top := con |
|
4585 ]. |
|
4586 con := con sender |
|
4587 ]. |
|
4588 " |
|
4589 use class&selector to find the method for the compilation |
|
4590 and compile. |
|
4591 " |
|
4592 sel := selectedContext selector. |
|
4593 implementorClass := selectedContext methodClass. |
|
4594 implementorClass notNil ifTrue:[ |
|
4595 method := implementorClass compiledMethodAt:sel. |
|
4596 category := method category |
|
4597 ] ifFalse:[ |
|
4598 implementorClass := selectedContext receiver class. |
|
4599 implementorClass ~~ Object ifTrue:[ |
|
4600 implementorClass := Dialog |
|
4601 request:('Define #''%1'' in which class:' bindWith:sel) |
|
4602 initialAnswer:implementorClass name |
|
4603 list:(implementorClass withAllSuperclasses collect:[:each| each name]). |
|
4604 implementorClass size == 0 ifTrue:[ |
|
4605 ^ cancelAction value "/ cancelled |
|
4606 ]. |
|
4607 implementorClass := Smalltalk at:implementorClass asSymbol. |
|
4608 implementorClass isNil ifTrue:[ |
|
4609 Dialog warn:'no such class'. |
|
4610 ^ cancelAction value "/ cancelled |
|
4611 ]. |
|
4612 ]. |
|
4613 category := '* As yet uncategorized *'. |
|
4614 ]. |
|
4615 |
|
4616 "/ |
|
4617 "/ provide the classes nameSpace on a query; |
|
4618 "/ in case we accept while in another nameSpace context, |
|
4619 "/ (but for a class which is somewhere else) |
|
4620 "/ |
|
4621 Class updateChangeFileQuerySignal answer:true |
|
4622 do:[ |
|
4623 Class updateChangeListQuerySignal answer:true |
|
4624 do:[ |
|
4625 Class nameSpaceQuerySignal |
|
4626 answer:(implementorClass nameSpace) |
|
4627 do:[ |
|
4628 newMethod := implementorClass compilerClass |
|
4629 compile:someCode |
|
4630 forClass:implementorClass |
|
4631 inCategory:category |
|
4632 notifying:codeView. |
|
4633 ]. |
|
4634 ]. |
|
4635 ]. |
|
4636 |
|
4637 inspecting ifFalse:[ |
|
4638 " |
|
4639 if it worked, remove everything up to and including top |
|
4640 from context chain |
|
4641 " |
|
4642 (newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[ |
|
4643 codeView modified:false. |
|
4644 |
|
4645 doUnwind ifTrue:[ |
|
4646 self setContext:(top sender). |
|
4647 |
|
4648 " |
|
4649 continue/step is no longer possible |
|
4650 " |
|
4651 canContinue := false. |
|
4652 exitAction := #return. |
|
4653 ]. |
|
4654 self showSelection:1. |
|
4655 ] ifFalse:[ |
|
4656 ^ cancelAction value |
|
4657 ] |
|
4658 ]. |
|
4659 ]. |
|
4660 |
|
4661 "Created: / 16.11.2001 / 13:42:39 / cg" |
|
4662 "Modified: / 16.11.2001 / 13:44:34 / cg" |
|
4663 ! |
|
4664 |
4535 doShowSelection:lineNr |
4665 doShowSelection:lineNr |
4536 "user clicked on a header line - show selected code in textView. |
4666 "user clicked on a header line - show selected code in textView. |
4537 Also sent to autoselect an interesting context on entry." |
4667 Also sent to autoselect an interesting context on entry." |
4538 |
4668 |
4539 |breakPointSignal| |
4669 |breakPointSignal| |
4880 ] ifFalse:[ |
5010 ] ifFalse:[ |
4881 codeView acceptAction:[:code | self device beep] |
5011 codeView acceptAction:[:code | self device beep] |
4882 ]. |
5012 ]. |
4883 |
5013 |
4884 receiverInspector inspect:rec. |
5014 receiverInspector inspect:rec. |
4885 receiverInspector tryToSelectedKeyNamed:lastSelectionInReceiverInspector. |
5015 receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector. |
4886 |
5016 |
4887 " |
5017 " |
4888 the one below is wrong: currently, the |
5018 the one below is wrong: currently, the |
4889 evaluator cannot handle passed contexts. |
5019 evaluator cannot handle passed contexts. |
4890 Once it does, pass con as in:-arg |
5020 Once it does, pass con as in:-arg |