#UI_ENHANCEMENT by cg
class: DebugView
better context-chain condensing
(when not showing the support code)
Now only one cehcktoggle in the menu)
comment/format in: #showingContext2:nesting:
changed:
#contextListEntryFor:
#setContext:releaseInspectors:
#showingContext1:calling:
#showingSupportCode:
class: DebugView class
changed: #viewMenuSpec
--- a/DebugView.st Mon Jun 25 18:12:04 2018 +0200
+++ b/DebugView.st Tue Jun 26 20:00:15 2018 +0200
@@ -1562,6 +1562,7 @@
itemValue: showingDenseWalkback:
hideMenuOnActivated: false
indication: showingDenseWalkback
+ isVisible: false
)
(MenuItem
enabled: notShowingDenseWalkbackHolder
@@ -1590,6 +1591,8 @@
nil
nil
)
+
+ "Modified: / 26-06-2018 / 19:56:56 / Claus Gittinger"
! !
!DebugView class methodsFor:'misc'!
@@ -6387,10 +6390,14 @@
!
showingSupportCode:aBoolean
+ "/ now only one flag!!
+ self showingDenseWalkback:(aBoolean not).
+
hideSupportCode := aBoolean not.
self redisplayBacktrace.
"Created: / 27-07-2012 / 14:58:00 / cg"
+ "Modified: / 26-06-2018 / 19:56:44 / Claus Gittinger"
!
showingVerboseWalkback
@@ -7770,6 +7777,7 @@
].
s := Text streamContents:[:s | aContext printWithSeparator:' ยป ' on:s ].
+s infoPrintCR.
RememberedCallChain notNil ifTrue:[
(RememberedCallChain includesIdentical:aContext) ifTrue:[
s := s withColor:#red.
@@ -7779,6 +7787,7 @@
].
"Created: / 21-05-2007 / 13:30:24 / cg"
+ "Modified: / 26-06-2018 / 19:15:12 / Claus Gittinger"
!
is:aHomeContext inCallingChainOf:aContext
@@ -8059,6 +8068,9 @@
].
].
+ "/ '---' infoPrintCR.
+ "/ con infoPrintCR.
+
[
|show1|
@@ -8068,6 +8080,7 @@
].
show1
] whileFalse:[
+ "/ 'skip1: ' infoPrint. con infoPrintCR.
calledContext := con.
con := con sender.
].
@@ -8087,15 +8100,18 @@
].
text add:nm.
count := count + 1.
+ ] ifFalse:[
+ "/ 'skip2: ' infoPrint. con infoPrintCR.
].
"/ with hidden support code, skip over internals of exceptions
- hideSupportCode == true ifTrue:[
+ false "hideSupportCode == true" ifTrue:[
"/ Transcript showCR:'x'.
(con isBlockContext
and:[ (h := con home) notNil
and:[ (self is:h inCallingChainOf:con) ]]) ifTrue:[
|blocksReceiver|
+
blocksReceiver := con receiver.
c := con sender.
[
@@ -8114,6 +8130,7 @@
]
]
] whileTrue:[
+ "/ 'skip3: ' infoPrint. c infoPrintCR.
c := sndr
].
c notNil ifTrue:[
@@ -8227,6 +8244,7 @@
"Created: / 14-12-1995 / 19:10:31 / cg"
"Modified: / 30-11-2017 / 12:16:08 / cg"
+ "Modified: / 26-06-2018 / 19:59:32 / Claus Gittinger"
!
setContextSkippingInterruptContexts:aContext
@@ -8255,50 +8273,93 @@
Here, we hide some well known methods, which are usually not too interesting;
the set of methods which are suppressed is my (claus's) own choice."
- |recIsException sel rec senderRec mthd mthdClass calledSel calledRec|
-
- self verboseBacktraceHolder value ifTrue:[ ^true ].
+ |recIsException recIsExceptionHandler
+ arg1IsException arg1IsExceptionHandler
+ sel rec arg1 senderRec mthd mthdClass calledSel calledRec|
+
+ self verboseBacktraceHolder value ifTrue:[
+ hideSupportCode ifFalse:[
+ ^ true
+ ].
+ ].
aContext isNil ifTrue:[ ^true ].
sel := aContext selector.
rec := aContext receiver.
+
mthd := aContext method.
mthd notNil ifTrue:[ mthdClass := mthd mclass ].
- "/ to avoid firing/waiting the lazy or future
- recIsException := (rec isProtoObject not) and:[rec isException].
+ recIsException := recIsExceptionHandler := false.
+ arg1IsException := arg1IsExceptionHandler := false.
+
+ "/ to avoid firing/waiting lazys or futures,
+ "/ and to avoid forwarding to bridges...
+ rec isProtoObject ifFalse:[
+ recIsException := rec isException.
+ recIsException ifFalse:[
+ recIsExceptionHandler := rec isExceptionHandler.
+ "/ signals are both creators and handlers
+ recIsException := (rec isExceptionCreator and:[recIsExceptionHandler])
+ ].
+ ].
+ aContext numArgs > 0 ifTrue:[
+ arg1 := aContext argAt:1.
+ "/ to avoid firing/waiting lazys or futures,
+ "/ and to avoid forwarding to bridges...
+ arg1 isProtoObject ifFalse:[
+ arg1IsException := arg1 isException.
+ arg1IsException ifFalse:[
+ arg1IsExceptionHandler := arg1 isExceptionHandler.
+ "/ signals are both creators and handlers
+ arg1IsException := (arg1 isExceptionCreator and:[arg1IsExceptionHandler])
+ ].
+ ].
+ ].
+
aContext sender notNil ifTrue:[
senderRec := aContext sender receiver
].
DebuggingDebugger3 == true ifTrue:[
- 'showingContext1: (' print. aContext print.
- ') calling: (' print. calledContext print.
- ')' printCR.
- ].
-
- (#(doCallHandler: doRaise
- ) includes:sel)
- ifTrue:[
- recIsException ifTrue:[ ^ false].
- ].
-
- (#(raise raiseRequest
- ) includes:sel)
- ifTrue:[
- recIsException ifTrue:[
- (senderRec isProtoObject not
- and:[ senderRec isExceptionCreator]) ifTrue:[^ false].
- ].
- ].
-
- (#(doWhile:
- ) includes:sel)
- ifTrue:[
- rec isBlock ifTrue:[
- true "aContext sender isBlockContext" ifTrue:[^ false].
- ].
- ].
+ 'showingContext1: ' infoPrint. aContext infoPrintCR.
+ 'calling: ' infoPrint. calledContext infoPrintCR.
+ ].
+
+ (
+ #( doCallHandler:
+ doRaise
+ raiseRequest
+ raiseRequestErrorString:
+ raiseRequestWith:errorString:
+ raiseRequestWith:errorString:in:
+ ) includes:sel
+ ) ifTrue:[
+ recIsException ifTrue:[ ^ false].
+ ].
+
+ (
+ #( raise
+ raiseRequest
+ ) includes:sel
+ ) ifTrue:[
+ recIsException ifTrue:[
+ (senderRec isProtoObject not
+ and:[ senderRec isExceptionCreator]) ifTrue:[^ false].
+ ].
+ ].
+
+ (
+ #(
+ doWhile:
+ ensure:
+ ifCurtailed:
+ ) includes:sel
+ ) ifTrue:[
+ (rec isProtoObject not and:[rec isBlock]) ifTrue:[
+ true "aContext sender isBlockContext" ifTrue:[^ false].
+ ].
+ ].
calledContext notNil ifTrue:[
calledSel := calledContext selector.
@@ -8310,35 +8371,49 @@
].
(calledSel == #handle:do:) ifTrue:[^ false].
(calledSel == #answer:do:) ifTrue:[^ false].
-
-"/ calledRec isProtoObject ifFalse:[
-"/ ((calledSel == #doWhile:)
-"/ and:[calledRec isBlock])
-"/ ifTrue:[^ false].
-"/
-"/ ((#(ensure: ifCurtailed: valueNowOrOnUnwindDo: valueOnUnwindDo:
-"/ ) includes:calledSel)
-"/ and:[calledRec isBlock])
-"/ ifTrue:[^ false].
-"/
-"/ ((calledSel == #handle:do:)
-"/ and:[calledRec isExceptionHandler])
-"/ ifTrue:[^ false].
-"/ ].
- ].
-
- (#(handleDo:) includes:sel)
- ifTrue:[
- (calledRec isProtoObject not and:[calledRec isExceptionHandler]) ifTrue:[^ false].
- ].
+ (calledSel == #on:do:) ifTrue:[^ false].
+ (calledSel == #on:do:ensure:) ifTrue:[^ false].
+
+ (
+ #(
+ perform: perform:with: perform:with:with:
+ perform:withArguments:
+ perform:withArguments:ifNotUnderstood:
+ ) includes:sel
+ ) ifTrue:[
+ calledSel == arg1 ifTrue:[^ false].
+ ].
+ ].
+
+ (
+ #(
+ handleDo:
+ handle:do:
+ answer:do:
+ ) includes:sel
+ ) ifTrue:[
+ recIsExceptionHandler ifTrue:[^ false].
+ "/ (calledRec isProtoObject not and:[calledRec isExceptionHandler]) ifTrue:[^ false].
+ ].
+
+ (
+ #(
+ on:do:
+ on:do:ensure:
+ ) includes:sel
+ ) ifTrue:[
+ arg1IsExceptionHandler ifTrue:[^ false].
+ "/ (calledRec isProtoObject not and:[calledRec isExceptionHandler]) ifTrue:[^ false].
+ ].
+
(#(
withCursor:do:
withWaitCursorDo:
withReadCursorDo:
withWriteCursorDo:
withSearchCursorDo:
- ) includes:sel)
- ifTrue:[
+ ) includes:sel
+ ) ifTrue:[
(mthdClass == TopView) ifTrue:[^ false].
(mthdClass == ApplicationModel) ifTrue:[^ false].
(mthdClass == WindowGroup) ifTrue:[^ false].
@@ -8348,16 +8423,32 @@
wait
waitWithTimeout:
waitWithTimeoutMs:
- ) includes:sel)
- ifTrue:[
+ ) includes:sel
+ ) ifTrue:[
(mthdClass == Semaphore) ifTrue:[^ false].
(mthdClass == SemaphoreSet) ifTrue:[^ false].
].
+ (#(
+ suspendWithState:
+ ) includes:sel
+ ) ifTrue:[
+ (mthdClass == Process) ifTrue:[^ false].
+ ].
+
+ (#(
+ suspend:
+ threadSwitch:
+ ) includes:sel
+ ) ifTrue:[
+ (mthdClass == ProcessorScheduler) ifTrue:[^ false].
+ ].
+
^ true
"Created: / 17-11-2001 / 22:24:06 / cg"
"Modified: / 27-07-2012 / 17:30:18 / cg"
+ "Modified: / 26-06-2018 / 19:58:56 / Claus Gittinger"
!
showingContext2:aContext nesting:nesting
@@ -8513,6 +8604,7 @@
"Created: / 17-11-2001 / 19:34:20 / cg"
"Modified: / 27-07-2012 / 17:26:54 / cg"
"Modified: / 31-01-2017 / 20:21:32 / stefan"
+ "Modified: / 26-06-2018 / 19:58:41 / Claus Gittinger"
! !
!DebugView methodsFor:'private-control loop'!