From f349383776ad81b2c7240a1e043156d3f0c3e1ad Mon Sep 17 00:00:00 2001 From: Joana Be Date: Fri, 19 Nov 2021 21:56:27 +0100 Subject: [PATCH 1/6] Changes layout of printbugger to resemble flame graph --- .../BPTraceValue.class/instance/filteredStack.st | 4 ++-- .../instance/filteredStackFor..st | 6 ------ .../instance/oneSidedStackLevelTo..st | 13 +++---------- .../oneSidedStackLevelToFilteredStack..st | 14 ++++++++++++++ .../instance/relativeStackLevelTo..st | 6 +++--- .../BPTraceValue.class/methodProperties.json | 8 ++++---- .../instance/barWidthFor.relativeTo..st | 6 ------ ...ativeTo..st => lineSubmorphsFor.calledBy..st} | 6 +++--- .../newBarMorphFor.calledBy.withHeight..st | 16 ++++++++++++++++ .../newBarMorphFor.relativeTo.withHeight..st | 9 --------- .../instance/newBarMorphFor.withHeight..st | 8 ++++++++ .../BPSwimlane.class/instance/stackDepth.st | 4 ++-- .../BPSwimlane.class/instance/stackDepthsFor..st | 6 +++--- .../instance/stackMethodsFor..st | 5 +++++ ...ativeTo..st => visualizeLineFor.calledBy..st} | 10 +++++----- .../instance/visualizeLinesFor..st | 8 ++++---- .../BPSwimlane.class/methodProperties.json | 15 ++++++++------- ...testSwimlaneDisplaysTraceValuesForOneProbe.st | 5 +++-- ...aceValuesForTwoProbesChronologicallySorted.st | 5 +++-- ...thodsGetDifferentColorsInMultipleSwimlanes.st | 8 +++++--- ...entMethodsGetDifferentColorsInSameSwimlane.st | 5 +++-- ...luesInSameMethodGetSameColorInSameSwimlane.st | 5 +++-- .../methodProperties.json | 10 +++++----- 23 files changed, 102 insertions(+), 80 deletions(-) delete mode 100644 packages/Babylonian-Core.package/BPTraceValue.class/instance/filteredStackFor..st create mode 100644 packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelToFilteredStack..st delete mode 100644 packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/barWidthFor.relativeTo..st rename packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/{lineSubmorphsFor.relativeTo..st => lineSubmorphsFor.calledBy..st} (68%) create mode 100644 packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.calledBy.withHeight..st delete mode 100644 packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.relativeTo.withHeight..st create mode 100644 packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.withHeight..st create mode 100644 packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackMethodsFor..st rename packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/{visualizeLineFor.relativeTo..st => visualizeLineFor.calledBy..st} (55%) diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/instance/filteredStack.st b/packages/Babylonian-Core.package/BPTraceValue.class/instance/filteredStack.st index b4b297c4..8d0b5619 100644 --- a/packages/Babylonian-Core.package/BPTraceValue.class/instance/filteredStack.st +++ b/packages/Babylonian-Core.package/BPTraceValue.class/instance/filteredStack.st @@ -1,6 +1,6 @@ private filteredStack - - ^ self filteredStackFor: self stack + + ^ self stack reject: [:aStackEntry | self shouldBeFiltered: aStackEntry ] \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/instance/filteredStackFor..st b/packages/Babylonian-Core.package/BPTraceValue.class/instance/filteredStackFor..st deleted file mode 100644 index 51660ea0..00000000 --- a/packages/Babylonian-Core.package/BPTraceValue.class/instance/filteredStackFor..st +++ /dev/null @@ -1,6 +0,0 @@ -private -filteredStackFor: aStack - - ^ aStack reject: [:aStackEntry | self shouldBeFiltered: aStackEntry ] - - \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelTo..st b/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelTo..st index edae03a7..fca9e177 100644 --- a/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelTo..st +++ b/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelTo..st @@ -1,14 +1,7 @@ private oneSidedStackLevelTo: anotherTraceValue - + "0: anotherTraceValue stack does not contain self containedMethodReference. - +x: stack level in which anotherTraceValue stack contains self containedMethodReference. - We traverse by reverse to cover recursive calls." - - |foundElementIndex| - foundElementIndex := (self filteredStackFor: anotherTraceValue stack) findLast: [:aStackEntry | - (aStackEntry third == self stack first third and: [aStackEntry fourth == self stack first fourth])]. + +x: stack level in which anotherTraceValue stack contains self containedMethodReference." - ^ foundElementIndex ~= 0 - ifTrue: [foundElementIndex-1] - ifFalse: [0] \ No newline at end of file + ^ self oneSidedStackLevelToFilteredStack: anotherTraceValue filteredStack \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelToFilteredStack..st b/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelToFilteredStack..st new file mode 100644 index 00000000..f176bec5 --- /dev/null +++ b/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelToFilteredStack..st @@ -0,0 +1,14 @@ +private +oneSidedStackLevelToFilteredStack: anotherFilteredStack + + "0: anotherFilteredStack does not contain self containedMethodReference. + +x: stack level in which anotherFilteredStack contains self containedMethodReference. + We traverse by reverse to cover recursive calls." + + |foundElementIndex| + foundElementIndex := anotherFilteredStack findLast: [:aStackEntry | + (aStackEntry third == self stack first third and: [aStackEntry fourth == self stack first fourth])]. + + ^ foundElementIndex ~= 0 + ifTrue: [foundElementIndex-1] + ifFalse: [0] \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/instance/relativeStackLevelTo..st b/packages/Babylonian-Core.package/BPTraceValue.class/instance/relativeStackLevelTo..st index 98014e90..3081a142 100644 --- a/packages/Babylonian-Core.package/BPTraceValue.class/instance/relativeStackLevelTo..st +++ b/packages/Babylonian-Core.package/BPTraceValue.class/instance/relativeStackLevelTo..st @@ -1,13 +1,13 @@ accessing relativeStackLevelTo: anotherTraceValue - + "-x: self stack calls anotherTraceValue by x calls. - 0: self strack and anotherTraceValue are called independently in the same method + 0: self stack and anotherTraceValue are called independently in the same method OR they are not related at all. +x: anotherTraceValue stacks calls self by x calls." - "First check trivial case: If two stack depths are the same they are either called in the same method or totally unrelated. If the two stacks are both full, the trivial check fails." + (self isStackFull not and: [self stack size == anotherTraceValue stack size]) ifTrue: [^ 0]. "If both stacks are full, the direction can also not be as easily concluded. Return the non zero one unless diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json b/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json index c695e08e..32f05625 100644 --- a/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json +++ b/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json @@ -11,12 +11,12 @@ "containedMethodReference" : "jb 7/2/2021 14:34", "filterableClassesInStack" : "jb 6/30/2021 00:58", "filterableMessagesInStack" : "jb 6/24/2021 22:43", - "filteredStack" : "jb 6/30/2021 00:53", - "filteredStackFor:" : "jb 6/30/2021 00:47", + "filteredStack" : "jb 11/19/2021 18:54", "isStackFull" : "jb 6/30/2021 01:26", - "oneSidedStackLevelTo:" : "jb 8/1/2021 21:24", + "oneSidedStackLevelTo:" : "jb 11/19/2021 19:01", + "oneSidedStackLevelToFilteredStack:" : "jb 11/19/2021 20:28", "printOn:" : "jb 5/19/2021 20:59", - "relativeStackLevelTo:" : "jb 7/2/2021 14:36", + "relativeStackLevelTo:" : "jb 11/19/2021 20:26", "shouldBeFiltered:" : "jb 6/30/2021 00:55", "stack" : "pre 5/8/2019 18:36", "stack:" : "jb 12/7/2020 18:55", diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/barWidthFor.relativeTo..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/barWidthFor.relativeTo..st deleted file mode 100644 index 318d2040..00000000 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/barWidthFor.relativeTo..st +++ /dev/null @@ -1,6 +0,0 @@ -constants -barWidthFor: aTraceValue relativeTo: aStackRelation - - ^ self stackDepth + (aStackRelation * self stackDepth) - - \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/lineSubmorphsFor.relativeTo..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/lineSubmorphsFor.calledBy..st similarity index 68% rename from packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/lineSubmorphsFor.relativeTo..st rename to packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/lineSubmorphsFor.calledBy..st index 7d2bc4ac..d43b1339 100644 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/lineSubmorphsFor.relativeTo..st +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/lineSubmorphsFor.calledBy..st @@ -1,12 +1,12 @@ private -lineSubmorphsFor: aTraceValue relativeTo: aStackRelation - +lineSubmorphsFor: aTraceValue calledBy: aStackOfMethodReferences + | valueMorph | valueMorph := self newLabelValuePairMorphFor: aTraceValue. ^ {self newHaltButtonFor: aTraceValue. self newBarMorphFor: aTraceValue - relativeTo: aStackRelation + calledBy: aStackOfMethodReferences withHeight: (valueMorph fullBounds height + 10). valueMorph.} \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.calledBy.withHeight..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.calledBy.withHeight..st new file mode 100644 index 00000000..dc10ed72 --- /dev/null +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.calledBy.withHeight..st @@ -0,0 +1,16 @@ +private - ui +newBarMorphFor: aTraceValue calledBy: aStackOfMethodReferences withHeight: aNumber + + + ^ Morph new + name: #stackBar; + color: Color transparent; + changeTableLayout; + listDirection: #rightToLeft; + wrapCentering: #center; + hResizing: #shrinkWrap; + vResizing: #shrinkWrap; + cellInset: 1@0; + addAllMorphsBack: (aStackOfMethodReferences collect: [:aStackMethod | + self newBarMorphFor: aStackMethod withHeight: aNumber]); + yourself \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.relativeTo.withHeight..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.relativeTo.withHeight..st deleted file mode 100644 index 6afbcc70..00000000 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.relativeTo.withHeight..st +++ /dev/null @@ -1,9 +0,0 @@ -private - ui -newBarMorphFor: aTraceValue relativeTo: aStackRelation withHeight: aNumber - - ^ Morph new - name: #stackBar; - color: (self colorFor: aTraceValue in: context); - extent: ((self barWidthFor: aTraceValue relativeTo: aStackRelation)@aNumber); - yourself. - \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.withHeight..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.withHeight..st new file mode 100644 index 00000000..7ddca47a --- /dev/null +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.withHeight..st @@ -0,0 +1,8 @@ +private - ui +newBarMorphFor: aMethodReference withHeight: aNumber + + ^ Morph new + color: (context colorFor: aMethodReference having: self class barColorScheme); + extent: (self stackDepth@aNumber); + yourself. + \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepth.st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepth.st index 0d431612..c31ece8f 100644 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepth.st +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepth.st @@ -1,4 +1,4 @@ constants stackDepth - - ^ self fontHeight \ No newline at end of file + + ^ self fontHeight / 1.25 \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepthsFor..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepthsFor..st index 2cc3310a..7c4936b3 100644 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepthsFor..st +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepthsFor..st @@ -1,10 +1,10 @@ private stackDepthsFor: aBPExample - - |stackDepthsRelativeToFirstLine lowestDepth| + + |stackDepthsRelativeToFirstLine lowestDepth a| stackDepthsRelativeToFirstLine := aBPExample traceValues collect: [:anotherTraceValue | aBPExample traceValues first relativeStackLevelTo: anotherTraceValue]. - + a := aBPExample traceValues collect: [:aTraceValue | aTraceValue filteredStack]. "the first trace value may be a method with a probe being called in a method which probes after the call, which would result in stacks going from right to left instead of the other way around (with being thinner). so normalize the depths before returning." lowestDepth := stackDepthsRelativeToFirstLine diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackMethodsFor..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackMethodsFor..st new file mode 100644 index 00000000..26283dfb --- /dev/null +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackMethodsFor..st @@ -0,0 +1,5 @@ +private +stackMethodsFor: aBPExample + + ^ aBPExample traceValues collect: [:aTraceValue | + aTraceValue filteredStack collect: [:aStackEntry | MethodReference class: aStackEntry fourth selector: aStackEntry third]] \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/visualizeLineFor.relativeTo..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/visualizeLineFor.calledBy..st similarity index 55% rename from packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/visualizeLineFor.relativeTo..st rename to packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/visualizeLineFor.calledBy..st index 5e73da0c..cda8c591 100644 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/visualizeLineFor.relativeTo..st +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/visualizeLineFor.calledBy..st @@ -1,6 +1,6 @@ private -visualizeLineFor: aTraceValue relativeTo: aStackRelation - +visualizeLineFor: aTraceValue calledBy: aStackOfMethodReferences + ^ Morph new name: aTraceValue chronologicalPosition asString; color: Color transparent; @@ -9,6 +9,6 @@ visualizeLineFor: aTraceValue relativeTo: aStackRelation cellPositioning: #center; vResizing: #shrinkWrap; hResizing: #shrinkWrap; - cellInset: 3@1; - addAllMorphsBack: (self lineSubmorphsFor: aTraceValue relativeTo: aStackRelation); - yourself. \ No newline at end of file + cellInset: 3@0; + addAllMorphsBack: (self lineSubmorphsFor: aTraceValue calledBy: aStackOfMethodReferences); + yourself \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/visualizeLinesFor..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/visualizeLinesFor..st index 883d9a2a..32a84571 100644 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/visualizeLinesFor..st +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/visualizeLinesFor..st @@ -1,8 +1,8 @@ private visualizeLinesFor: aBPExample - - |stackDepthsRelativeToFirstLine| - stackDepthsRelativeToFirstLine := self stackDepthsFor: aBPExample. + + | stackMethods | + stackMethods := self stackMethodsFor: aBPExample. "Add a wrapper to have some distance between the title morph and the values" ^ Morph new @@ -14,5 +14,5 @@ visualizeLinesFor: aBPExample wrapCentering: #center; cellPositioning: #topLeft; addAllMorphsBack: (aBPExample traceValues withIndexCollect: [:aTraceValue :anIndex | - self visualizeLineFor: aTraceValue relativeTo: (stackDepthsRelativeToFirstLine at: anIndex )]); + self visualizeLineFor: aTraceValue calledBy: (stackMethods at: anIndex )]); yourself \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json b/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json index ccc6f964..2b69d564 100644 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json @@ -5,7 +5,6 @@ "newFor:" : "jb 6/10/2021 23:33", "newFor:withContext:" : "jb 6/10/2021 23:24" }, "instance" : { - "barWidthFor:relativeTo:" : "jb 6/25/2021 00:34", "colorFor:in:" : "jb 6/11/2021 01:04", "context:" : "jb 6/10/2021 23:26", "example:" : "jb 6/10/2021 15:06", @@ -15,8 +14,9 @@ "initialize" : "jb 6/10/2021 23:34", "initializeProperties" : "jb 7/10/2021 16:37", "lineSubMorphs" : "jb 7/10/2021 17:43", - "lineSubmorphsFor:relativeTo:" : "jb 7/10/2021 16:57", - "newBarMorphFor:relativeTo:withHeight:" : "jb 6/30/2021 03:10", + "lineSubmorphsFor:calledBy:" : "jb 11/19/2021 21:37", + "newBarMorphFor:calledBy:withHeight:" : "jb 11/19/2021 21:45", + "newBarMorphFor:withHeight:" : "jb 11/19/2021 21:35", "newHaltButtonFor:" : "lu 6/17/2021 13:44", "newLabelFor:" : "jb 7/10/2021 17:13", "newLabelMorphFor:" : "jb 7/10/2021 17:14", @@ -24,10 +24,11 @@ "newTitleMorphFor:" : "lu 7/20/2021 21:21", "positionInProbeFor:and:" : "jb 6/24/2021 22:21", "scrollBarSize" : "lu 6/9/2021 23:47", - "stackDepth" : "jb 7/10/2021 16:50", - "stackDepthsFor:" : "jb 6/30/2021 02:18", + "stackDepth" : "jb 11/19/2021 18:29", + "stackDepthsFor:" : "jb 11/19/2021 21:15", + "stackMethodsFor:" : "jb 11/19/2021 21:21", "update:with:" : "jb 7/1/2021 23:47", "updateLayoutToContext" : "jb 7/10/2021 17:43", "visualize" : "jb 7/10/2021 16:41", - "visualizeLineFor:relativeTo:" : "jb 7/10/2021 16:57", - "visualizeLinesFor:" : "jb 7/10/2021 16:56" } } + "visualizeLineFor:calledBy:" : "jb 11/19/2021 21:45", + "visualizeLinesFor:" : "jb 11/19/2021 21:39" } } diff --git a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testSwimlaneDisplaysTraceValuesForOneProbe.st b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testSwimlaneDisplaysTraceValuesForOneProbe.st index b459f66f..16accb05 100644 --- a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testSwimlaneDisplaysTraceValuesForOneProbe.st +++ b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testSwimlaneDisplaysTraceValuesForOneProbe.st @@ -1,11 +1,12 @@ tests testSwimlaneDisplaysTraceValuesForOneProbe - + | swimlane traceValues| self initExample1WithMethodWithMultipleProbes. swimlane := printbugger canvasMorph firstSubmorph. self assert: (swimlane isKindOf: BPSwimlane). self assert: 6 equals: (swimlane lineSubMorphs size). - traceValues := swimlane allMorphs select: [:aSubmorph | aSubmorph isKindOf: StringMorph] thenCollect: [:aStringMorph | aStringMorph contents]. + traceValues := swimlane allMorphs select: [:aSubmorph | + aSubmorph isKindOf: StringMorph] thenCollect: [:aStringMorph | aStringMorph contents]. self assert: (traceValues includesAllOf: {'1'. '2'. '2'. '4'. '3'. '6'.}). \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testSwimlaneDisplaysTraceValuesForTwoProbesChronologicallySorted.st b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testSwimlaneDisplaysTraceValuesForTwoProbesChronologicallySorted.st index 9962e685..42a381d4 100644 --- a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testSwimlaneDisplaysTraceValuesForTwoProbesChronologicallySorted.st +++ b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testSwimlaneDisplaysTraceValuesForTwoProbesChronologicallySorted.st @@ -1,10 +1,11 @@ tests testSwimlaneDisplaysTraceValuesForTwoProbesChronologicallySorted - + |swimlane traceValues traceIndexes| self initExample1WithMethodWithMultipleProbes. swimlane := BPSwimlane newFor: example1. - traceValues := swimlane allMorphs select: [:aSubmorph | aSubmorph isKindOf: StringMorph] thenCollect: [:aStringMorph | aStringMorph contents]. + traceValues := swimlane allMorphs select: [:aSubmorph | + aSubmorph isKindOf: StringMorph] thenCollect: [:aStringMorph | aStringMorph contents]. self assert: (traceValues includesAllOf: {'1'. '2'. '2'. '4'. '3'. '6'.}). traceIndexes := {'1'. '2'. '2'. '4'. '3'. '6'.} collect: [:aTraceString | traceValues indexOf: aTraceString]. self assert: traceIndexes isSorted. diff --git a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentColorsInMultipleSwimlanes.st b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentColorsInMultipleSwimlanes.st index 778b03a2..1a73088c 100644 --- a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentColorsInMultipleSwimlanes.st +++ b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentColorsInMultipleSwimlanes.st @@ -1,14 +1,16 @@ tests testTwoTraceValuesInDifferentMethodsGetDifferentColorsInMultipleSwimlanes - + |swimlane1 swimlane2 colors1 colors2| self initExample1WithMethodWithMultipleProbes. self initExample2WithSingleProbe. swimlane1 := printbugger canvasMorph firstSubmorph. swimlane2 := printbugger canvasMorph submorphs second. - colors1 := (swimlane1 allMorphs select: [:aSubmorph | aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph color]) asSet. - colors2 := (swimlane2 allMorphs select: [:aSubmorph | aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph color]) asSet. + colors1 := (swimlane1 allMorphs select: [:aSubmorph | + aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph firstSubmorph color]) asSet. + colors2 := (swimlane2 allMorphs select: [:aSubmorph | + aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph firstSubmorph color]) asSet. self assert: colors1 size equals: colors2 size. self assert: colors1 ~= colors2. \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentColorsInSameSwimlane.st b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentColorsInSameSwimlane.st index bed8be39..daf9bc65 100644 --- a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentColorsInSameSwimlane.st +++ b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentColorsInSameSwimlane.st @@ -1,10 +1,11 @@ tests testTwoTraceValuesInDifferentMethodsGetDifferentColorsInSameSwimlane - + |swimlane colors| self initExample1WithMethodWithExampleCallingOnlyProbedMethod. swimlane := printbugger canvasMorph firstSubmorph. - colors := (swimlane allMorphs select: [:aSubmorph | aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph color]) asSet. + colors := (swimlane allMorphs select: [:aSubmorph | + aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph firstSubmorph color]) asSet. self assert: 2 equals: colors size. \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInSameMethodGetSameColorInSameSwimlane.st b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInSameMethodGetSameColorInSameSwimlane.st index 66b3b5ff..c2b12f20 100644 --- a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInSameMethodGetSameColorInSameSwimlane.st +++ b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInSameMethodGetSameColorInSameSwimlane.st @@ -1,11 +1,12 @@ tests testTwoTraceValuesInSameMethodGetSameColorInSameSwimlane - + |swimlane colors| self initExample1WithMethodWithMultipleProbes. swimlane := printbugger canvasMorph firstSubmorph. - colors := (swimlane allMorphs select: [:aSubmorph | aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph color]) asSet. + colors := (swimlane allMorphs select: [:aSubmorph | + aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph firstSubmorph color]) asSet. self assert: 1 equals: colors size. \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/methodProperties.json b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/methodProperties.json index 4f162de7..db18076b 100644 --- a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/methodProperties.json +++ b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/methodProperties.json @@ -12,14 +12,14 @@ "tearDown" : "jb 7/2/2021 00:50", "testShows2SwimlanesFor2ActiveExamples" : "jb 6/2/2021 21:56", "testShowsNoSwimlanesForNoActiveExamples" : "jb 5/31/2021 14:20", - "testSwimlaneDisplaysTraceValuesForOneProbe" : "jb 7/10/2021 17:45", - "testSwimlaneDisplaysTraceValuesForTwoProbesChronologicallySorted" : "jb 6/30/2021 03:24", + "testSwimlaneDisplaysTraceValuesForOneProbe" : "jb 11/19/2021 21:52", + "testSwimlaneDisplaysTraceValuesForTwoProbesChronologicallySorted" : "jb 11/19/2021 21:52", "testSwimlaneEmptyForNoProbes" : "jb 7/10/2021 17:44", - "testTwoTraceValuesInDifferentMethodsGetDifferentColorsInMultipleSwimlanes" : "jb 7/2/2021 14:48", - "testTwoTraceValuesInDifferentMethodsGetDifferentColorsInSameSwimlane" : "jb 7/2/2021 01:00", + "testTwoTraceValuesInDifferentMethodsGetDifferentColorsInMultipleSwimlanes" : "jb 11/19/2021 21:52", + "testTwoTraceValuesInDifferentMethodsGetDifferentColorsInSameSwimlane" : "jb 11/19/2021 21:52", "testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane" : "jb 7/2/2021 14:49", "testTwoTraceValuesInSameMethodGetSameColorInMultipleSwimlanes" : "jb 7/2/2021 00:31", - "testTwoTraceValuesInSameMethodGetSameColorInSameSwimlane" : "jb 7/2/2021 00:30", + "testTwoTraceValuesInSameMethodGetSameColorInSameSwimlane" : "jb 11/19/2021 21:50", "testUpdatesSwimlanesAfterDeactivatingExample" : "jb 7/2/2021 14:50", "testUpdatesSwimlanesAfterNewActiveExample" : "jb 7/2/2021 14:51", "usedMethods" : "jb 7/2/2021 00:57" } } From a4dcfd30bbed300f08e714ee41a3779a4fea892e Mon Sep 17 00:00:00 2001 From: Joana Be Date: Fri, 19 Nov 2021 22:35:04 +0100 Subject: [PATCH 2/6] Enters hover and click interaction for printbugger stack frames --- .../newBarMorphFor.calledBy.withHeight..st | 2 +- .../instance/newBarMorphFor.withHeight..st | 8 ------- .../newStackFrameMorphFor.withHeight..st | 24 +++++++++++++++++++ .../BPSwimlane.class/methodProperties.json | 4 ++-- 4 files changed, 27 insertions(+), 11 deletions(-) delete mode 100644 packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.withHeight..st create mode 100644 packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newStackFrameMorphFor.withHeight..st diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.calledBy.withHeight..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.calledBy.withHeight..st index dc10ed72..0fabf412 100644 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.calledBy.withHeight..st +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.calledBy.withHeight..st @@ -12,5 +12,5 @@ newBarMorphFor: aTraceValue calledBy: aStackOfMethodReferences withHeight: aNumb vResizing: #shrinkWrap; cellInset: 1@0; addAllMorphsBack: (aStackOfMethodReferences collect: [:aStackMethod | - self newBarMorphFor: aStackMethod withHeight: aNumber]); + self newStackFrameMorphFor: aStackMethod withHeight: aNumber]); yourself \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.withHeight..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.withHeight..st deleted file mode 100644 index 7ddca47a..00000000 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.withHeight..st +++ /dev/null @@ -1,8 +0,0 @@ -private - ui -newBarMorphFor: aMethodReference withHeight: aNumber - - ^ Morph new - color: (context colorFor: aMethodReference having: self class barColorScheme); - extent: (self stackDepth@aNumber); - yourself. - \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newStackFrameMorphFor.withHeight..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newStackFrameMorphFor.withHeight..st new file mode 100644 index 00000000..dee46286 --- /dev/null +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newStackFrameMorphFor.withHeight..st @@ -0,0 +1,24 @@ +private - ui +newStackFrameMorphFor: aMethodReference withHeight: aNumber + + | stackMorph | + stackMorph := Morph new + color: (context colorFor: aMethodReference having: self class barColorScheme); + extent: (self stackDepth@aNumber); + balloonText: aMethodReference asString; + on: #click + send: #value + to: [ToolSet browse: aMethodReference actualClass + selector: aMethodReference selector]; + yourself. + + stackMorph + on: #mouseEnter + send: #value + to: [stackMorph borderStyle: (BorderStyle width: 2 color: Color black)]; + on: #mouseLeave + send: #value + to: [stackMorph borderStyle: nil]. + + ^ stackMorph + \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json b/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json index 2b69d564..12c721c0 100644 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json @@ -15,12 +15,12 @@ "initializeProperties" : "jb 7/10/2021 16:37", "lineSubMorphs" : "jb 7/10/2021 17:43", "lineSubmorphsFor:calledBy:" : "jb 11/19/2021 21:37", - "newBarMorphFor:calledBy:withHeight:" : "jb 11/19/2021 21:45", - "newBarMorphFor:withHeight:" : "jb 11/19/2021 21:35", + "newBarMorphFor:calledBy:withHeight:" : "jb 11/19/2021 21:58", "newHaltButtonFor:" : "lu 6/17/2021 13:44", "newLabelFor:" : "jb 7/10/2021 17:13", "newLabelMorphFor:" : "jb 7/10/2021 17:14", "newLabelValuePairMorphFor:" : "jb 7/10/2021 17:14", + "newStackFrameMorphFor:withHeight:" : "jb 11/19/2021 22:31", "newTitleMorphFor:" : "lu 7/20/2021 21:21", "positionInProbeFor:and:" : "jb 6/24/2021 22:21", "scrollBarSize" : "lu 6/9/2021 23:47", From 3a96aaa7c772071283bf9f37c3258d80cddde490 Mon Sep 17 00:00:00 2001 From: Joana Be Date: Fri, 19 Nov 2021 23:46:35 +0100 Subject: [PATCH 3/6] Removes unused methods --- .../instance/oneSidedStackLevelTo..st | 7 ----- .../oneSidedStackLevelToFilteredStack..st | 14 ---------- .../instance/relativeStackLevelTo..st | 28 ------------------- .../BPTraceValue.class/methodProperties.json | 3 -- .../instance/stackDepthsFor..st | 17 ----------- .../BPSwimlane.class/methodProperties.json | 1 - 6 files changed, 70 deletions(-) delete mode 100644 packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelTo..st delete mode 100644 packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelToFilteredStack..st delete mode 100644 packages/Babylonian-Core.package/BPTraceValue.class/instance/relativeStackLevelTo..st delete mode 100644 packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepthsFor..st diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelTo..st b/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelTo..st deleted file mode 100644 index fca9e177..00000000 --- a/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelTo..st +++ /dev/null @@ -1,7 +0,0 @@ -private -oneSidedStackLevelTo: anotherTraceValue - - "0: anotherTraceValue stack does not contain self containedMethodReference. - +x: stack level in which anotherTraceValue stack contains self containedMethodReference." - - ^ self oneSidedStackLevelToFilteredStack: anotherTraceValue filteredStack \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelToFilteredStack..st b/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelToFilteredStack..st deleted file mode 100644 index f176bec5..00000000 --- a/packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelToFilteredStack..st +++ /dev/null @@ -1,14 +0,0 @@ -private -oneSidedStackLevelToFilteredStack: anotherFilteredStack - - "0: anotherFilteredStack does not contain self containedMethodReference. - +x: stack level in which anotherFilteredStack contains self containedMethodReference. - We traverse by reverse to cover recursive calls." - - |foundElementIndex| - foundElementIndex := anotherFilteredStack findLast: [:aStackEntry | - (aStackEntry third == self stack first third and: [aStackEntry fourth == self stack first fourth])]. - - ^ foundElementIndex ~= 0 - ifTrue: [foundElementIndex-1] - ifFalse: [0] \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/instance/relativeStackLevelTo..st b/packages/Babylonian-Core.package/BPTraceValue.class/instance/relativeStackLevelTo..st deleted file mode 100644 index 3081a142..00000000 --- a/packages/Babylonian-Core.package/BPTraceValue.class/instance/relativeStackLevelTo..st +++ /dev/null @@ -1,28 +0,0 @@ -accessing -relativeStackLevelTo: anotherTraceValue - - "-x: self stack calls anotherTraceValue by x calls. - 0: self stack and anotherTraceValue are called independently in the same method - OR they are not related at all. - +x: anotherTraceValue stacks calls self by x calls." - "First check trivial case: If two stack depths are the same they are either called in the same - method or totally unrelated. If the two stacks are both full, the trivial check fails." - - (self isStackFull not and: [self stack size == anotherTraceValue stack size]) ifTrue: [^ 0]. - - "If both stacks are full, the direction can also not be as easily concluded. Return the non zero one unless - both directions result in a depth of zero." - (self isStackFull and: [anotherTraceValue isStackFull]) ifTrue: [ - {self oneSidedStackLevelTo: anotherTraceValue. (anotherTraceValue oneSidedStackLevelTo: self) negated} - detect: [:aStackDepth | aStackDepth ~= 0] - ifFound: [:theStackDepth | ^ theStackDepth] - ifNone: [^ 0]]. - - "else self can only be called if the stack size of other is bigger & vice visa." - (self stack size < anotherTraceValue stack size) - ifTrue: [^ self oneSidedStackLevelTo: anotherTraceValue] - ifFalse: [^ (anotherTraceValue oneSidedStackLevelTo: self) negated]. - - - - \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json b/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json index 32f05625..6c493741 100644 --- a/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json +++ b/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json @@ -13,10 +13,7 @@ "filterableMessagesInStack" : "jb 6/24/2021 22:43", "filteredStack" : "jb 11/19/2021 18:54", "isStackFull" : "jb 6/30/2021 01:26", - "oneSidedStackLevelTo:" : "jb 11/19/2021 19:01", - "oneSidedStackLevelToFilteredStack:" : "jb 11/19/2021 20:28", "printOn:" : "jb 5/19/2021 20:59", - "relativeStackLevelTo:" : "jb 11/19/2021 20:26", "shouldBeFiltered:" : "jb 6/30/2021 00:55", "stack" : "pre 5/8/2019 18:36", "stack:" : "jb 12/7/2020 18:55", diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepthsFor..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepthsFor..st deleted file mode 100644 index 7c4936b3..00000000 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepthsFor..st +++ /dev/null @@ -1,17 +0,0 @@ -private -stackDepthsFor: aBPExample - - |stackDepthsRelativeToFirstLine lowestDepth a| - stackDepthsRelativeToFirstLine := aBPExample traceValues collect: [:anotherTraceValue | - aBPExample traceValues first relativeStackLevelTo: anotherTraceValue]. - a := aBPExample traceValues collect: [:aTraceValue | aTraceValue filteredStack]. - "the first trace value may be a method with a probe being called in a method which probes after the call, which would result - in stacks going from right to left instead of the other way around (with being thinner). so normalize the depths before returning." - lowestDepth := stackDepthsRelativeToFirstLine - ifNotEmpty: [stackDepthsRelativeToFirstLine min] - ifEmpty: [0]. - - (lowestDepth < 0) - ifTrue: [stackDepthsRelativeToFirstLine replace: [:aStackDepth |aStackDepth - lowestDepth]]. - - ^ stackDepthsRelativeToFirstLine \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json b/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json index 12c721c0..b4f612c1 100644 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json @@ -25,7 +25,6 @@ "positionInProbeFor:and:" : "jb 6/24/2021 22:21", "scrollBarSize" : "lu 6/9/2021 23:47", "stackDepth" : "jb 11/19/2021 18:29", - "stackDepthsFor:" : "jb 11/19/2021 21:15", "stackMethodsFor:" : "jb 11/19/2021 21:21", "update:with:" : "jb 7/1/2021 23:47", "updateLayoutToContext" : "jb 7/10/2021 17:43", From 06cd1b5701d37c731790af5e8ab5ce77b4c5a54d Mon Sep 17 00:00:00 2001 From: Joana Be Date: Sat, 20 Nov 2021 01:40:09 +0100 Subject: [PATCH 4/6] Fixes the update of stack entry colors on new methods --- .../BPTraceValue.class/instance/filterableMessagesInStack.st | 4 ++-- .../BPTraceValue.class/methodProperties.json | 2 +- .../BPSwimlane.class/instance/colorFor..st | 4 ++++ .../instance/newStackFrameMorphFor.withHeight..st | 4 +++- .../BPSwimlane.class/instance/updateLayoutToContext.st | 5 +++-- .../BPSwimlane.class/methodProperties.json | 5 +++-- 6 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/colorFor..st diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableMessagesInStack.st b/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableMessagesInStack.st index 262d550b..e4c944a4 100644 --- a/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableMessagesInStack.st +++ b/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableMessagesInStack.st @@ -1,6 +1,6 @@ private filterableMessagesInStack - + ^ {MethodReference class: BlockClosure selector: #newProcess. MethodReference class: BPExample selector: #traceInBackground. MethodReference class: BlockClosure selector: #on:do:. @@ -18,4 +18,4 @@ filterableMessagesInStack MethodReference class: CSMethodObject selector: #run:with:in:. MethodReference class: CSLayeredMethod selector: #valueWithReceiver:arguments:. MethodReference class: CSPartialMethod selector: #valueWithReceiver:arguments:. - MethodReference class: BlockClosure selector: #whileFalseDo:.} \ No newline at end of file + MethodReference class: MorphicEventDispatcher selector: #dispatchEvent:toSubmorphsOf:.} \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json b/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json index 6c493741..b109f390 100644 --- a/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json +++ b/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json @@ -10,7 +10,7 @@ "chronologicalPosition:" : "jb 5/20/2021 14:50", "containedMethodReference" : "jb 7/2/2021 14:34", "filterableClassesInStack" : "jb 6/30/2021 00:58", - "filterableMessagesInStack" : "jb 6/24/2021 22:43", + "filterableMessagesInStack" : "jb 11/20/2021 01:15", "filteredStack" : "jb 11/19/2021 18:54", "isStackFull" : "jb 6/30/2021 01:26", "printOn:" : "jb 5/19/2021 20:59", diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/colorFor..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/colorFor..st new file mode 100644 index 00000000..83187bf3 --- /dev/null +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/colorFor..st @@ -0,0 +1,4 @@ +private +colorFor: aMethodReference + + ^ context colorFor: aMethodReference having: self class barColorScheme \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newStackFrameMorphFor.withHeight..st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newStackFrameMorphFor.withHeight..st index dee46286..3006ba82 100644 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newStackFrameMorphFor.withHeight..st +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/newStackFrameMorphFor.withHeight..st @@ -3,9 +3,11 @@ newStackFrameMorphFor: aMethodReference withHeight: aNumber | stackMorph | stackMorph := Morph new - color: (context colorFor: aMethodReference having: self class barColorScheme); + color: (self colorFor: aMethodReference); extent: (self stackDepth@aNumber); balloonText: aMethodReference asString; + setProperty: #stackMethodReference + toValue: aMethodReference; on: #click send: #value to: [ToolSet browse: aMethodReference actualClass diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/updateLayoutToContext.st b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/updateLayoutToContext.st index 3ff203ac..30bc854b 100644 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/updateLayoutToContext.st +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/updateLayoutToContext.st @@ -1,5 +1,6 @@ change notifications updateLayoutToContext - + self lineSubMorphs withIndexDo: [:aTraceValueLine :anIndex | - (aTraceValueLine submorphNamed: #stackBar) color: (self colorFor: (example traceValues at: anIndex) in: context)]. \ No newline at end of file + (aTraceValueLine submorphNamed: #stackBar) submorphsDo: [:aStackEntry | + aStackEntry color: (self colorFor: (aStackEntry valueOfProperty: #stackMethodReference))]]. \ No newline at end of file diff --git a/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json b/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json index b4f612c1..dcf379dd 100644 --- a/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json +++ b/packages/Babylonian-Printbugger.package/BPSwimlane.class/methodProperties.json @@ -5,6 +5,7 @@ "newFor:" : "jb 6/10/2021 23:33", "newFor:withContext:" : "jb 6/10/2021 23:24" }, "instance" : { + "colorFor:" : "jb 11/20/2021 01:29", "colorFor:in:" : "jb 6/11/2021 01:04", "context:" : "jb 6/10/2021 23:26", "example:" : "jb 6/10/2021 15:06", @@ -20,14 +21,14 @@ "newLabelFor:" : "jb 7/10/2021 17:13", "newLabelMorphFor:" : "jb 7/10/2021 17:14", "newLabelValuePairMorphFor:" : "jb 7/10/2021 17:14", - "newStackFrameMorphFor:withHeight:" : "jb 11/19/2021 22:31", + "newStackFrameMorphFor:withHeight:" : "jb 11/20/2021 01:32", "newTitleMorphFor:" : "lu 7/20/2021 21:21", "positionInProbeFor:and:" : "jb 6/24/2021 22:21", "scrollBarSize" : "lu 6/9/2021 23:47", "stackDepth" : "jb 11/19/2021 18:29", "stackMethodsFor:" : "jb 11/19/2021 21:21", "update:with:" : "jb 7/1/2021 23:47", - "updateLayoutToContext" : "jb 7/10/2021 17:43", + "updateLayoutToContext" : "jb 11/20/2021 01:33", "visualize" : "jb 7/10/2021 16:41", "visualizeLineFor:calledBy:" : "jb 11/19/2021 21:45", "visualizeLinesFor:" : "jb 11/19/2021 21:39" } } From 9f893c6462b1267144e67cf0618cbb86fa087783 Mon Sep 17 00:00:00 2001 From: Joana Be Date: Sat, 20 Nov 2021 01:57:43 +0100 Subject: [PATCH 5/6] Fixes failing tests as the stack of the test was overflowing --- .../instance/filterableClassesInStack.st | 11 ++++++++--- .../instance/filterableMessagesInStack.st | 3 +-- .../BPTraceValue.class/methodProperties.json | 4 ++-- ...entMethodsGetDifferentStackDepthsInSameSwimlane.st | 5 +++-- .../BPPrintbuggerTest.class/methodProperties.json | 6 +++--- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableClassesInStack.st b/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableClassesInStack.st index 51f792e7..91c7e3d9 100644 --- a/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableClassesInStack.st +++ b/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableClassesInStack.st @@ -1,12 +1,17 @@ private filterableClassesInStack - - ^ {BlockClosure. + + ^ { BlockClosure. Symbol. DynamicVariable class. + ActiveHandVariable class. CSProcessContextInformation. CSMethodObject. CSLayeredMethod. CSPartialMethod. TestCase. - TestResult.} \ No newline at end of file + TestResult. + BPPrintbuggerTest. + MorphicEventDispatcher. + HandMorph. + } \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableMessagesInStack.st b/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableMessagesInStack.st index e4c944a4..247c2e37 100644 --- a/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableMessagesInStack.st +++ b/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableMessagesInStack.st @@ -17,5 +17,4 @@ filterableMessagesInStack MethodReference class: BPMethodExample selector: #runOn:. MethodReference class: CSMethodObject selector: #run:with:in:. MethodReference class: CSLayeredMethod selector: #valueWithReceiver:arguments:. - MethodReference class: CSPartialMethod selector: #valueWithReceiver:arguments:. - MethodReference class: MorphicEventDispatcher selector: #dispatchEvent:toSubmorphsOf:.} \ No newline at end of file + MethodReference class: CSPartialMethod selector: #valueWithReceiver:arguments:.} \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json b/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json index b109f390..15ec21fb 100644 --- a/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json +++ b/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json @@ -9,8 +9,8 @@ "chronologicalPosition" : "jb 5/20/2021 14:50", "chronologicalPosition:" : "jb 5/20/2021 14:50", "containedMethodReference" : "jb 7/2/2021 14:34", - "filterableClassesInStack" : "jb 6/30/2021 00:58", - "filterableMessagesInStack" : "jb 11/20/2021 01:15", + "filterableClassesInStack" : "jb 11/20/2021 01:55", + "filterableMessagesInStack" : "jb 11/20/2021 01:52", "filteredStack" : "jb 11/19/2021 18:54", "isStackFull" : "jb 6/30/2021 01:26", "printOn:" : "jb 5/19/2021 20:59", diff --git a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane.st b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane.st index e689da2a..5762ecdb 100644 --- a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane.st +++ b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane.st @@ -1,11 +1,12 @@ tests testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane - + |swimlane stackDepths| self initExample1WithMethodWithExampleCallingOnlyProbedMethod. swimlane := printbugger canvasMorph firstSubmorph. - stackDepths := swimlane allMorphs select: [:aSubmorph | aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph width]. + stackDepths := swimlane allMorphs select: [:aSubmorph | + aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph fullBounds width]. self assert: 2 equals: stackDepths asSet size. self assert: stackDepths first < stackDepths second. \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/methodProperties.json b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/methodProperties.json index db18076b..b5806cd4 100644 --- a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/methodProperties.json +++ b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/methodProperties.json @@ -15,9 +15,9 @@ "testSwimlaneDisplaysTraceValuesForOneProbe" : "jb 11/19/2021 21:52", "testSwimlaneDisplaysTraceValuesForTwoProbesChronologicallySorted" : "jb 11/19/2021 21:52", "testSwimlaneEmptyForNoProbes" : "jb 7/10/2021 17:44", - "testTwoTraceValuesInDifferentMethodsGetDifferentColorsInMultipleSwimlanes" : "jb 11/19/2021 21:52", - "testTwoTraceValuesInDifferentMethodsGetDifferentColorsInSameSwimlane" : "jb 11/19/2021 21:52", - "testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane" : "jb 7/2/2021 14:49", + "testTwoTraceValuesInDifferentMethodsGetDifferentColorsInMultipleSwimlanes" : "jb 11/20/2021 01:35", + "testTwoTraceValuesInDifferentMethodsGetDifferentColorsInSameSwimlane" : "jb 11/20/2021 01:38", + "testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane" : "jb 11/20/2021 01:47", "testTwoTraceValuesInSameMethodGetSameColorInMultipleSwimlanes" : "jb 7/2/2021 00:31", "testTwoTraceValuesInSameMethodGetSameColorInSameSwimlane" : "jb 11/19/2021 21:50", "testUpdatesSwimlanesAfterDeactivatingExample" : "jb 7/2/2021 14:50", From b16737bcc364d53a24521c8b6f37072dc890207f Mon Sep 17 00:00:00 2001 From: Joana Be Date: Sat, 20 Nov 2021 02:08:13 +0100 Subject: [PATCH 6/6] Changes test logic slightly as stack size in test would need to add a lot more filters --- .../BPTraceValue.class/instance/filterableClassesInStack.st | 3 --- .../BPTraceValue.class/methodProperties.json | 2 +- ...sInDifferentMethodsGetDifferentStackDepthsInSameSwimlane.st | 3 +-- .../BPPrintbuggerTest.class/methodProperties.json | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableClassesInStack.st b/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableClassesInStack.st index 91c7e3d9..961b239a 100644 --- a/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableClassesInStack.st +++ b/packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableClassesInStack.st @@ -4,7 +4,6 @@ filterableClassesInStack ^ { BlockClosure. Symbol. DynamicVariable class. - ActiveHandVariable class. CSProcessContextInformation. CSMethodObject. CSLayeredMethod. @@ -12,6 +11,4 @@ filterableClassesInStack TestCase. TestResult. BPPrintbuggerTest. - MorphicEventDispatcher. - HandMorph. } \ No newline at end of file diff --git a/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json b/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json index 15ec21fb..160960cd 100644 --- a/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json +++ b/packages/Babylonian-Core.package/BPTraceValue.class/methodProperties.json @@ -9,7 +9,7 @@ "chronologicalPosition" : "jb 5/20/2021 14:50", "chronologicalPosition:" : "jb 5/20/2021 14:50", "containedMethodReference" : "jb 7/2/2021 14:34", - "filterableClassesInStack" : "jb 11/20/2021 01:55", + "filterableClassesInStack" : "jb 11/20/2021 02:07", "filterableMessagesInStack" : "jb 11/20/2021 01:52", "filteredStack" : "jb 11/19/2021 18:54", "isStackFull" : "jb 6/30/2021 01:26", diff --git a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane.st b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane.st index 5762ecdb..c7af2548 100644 --- a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane.st +++ b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane.st @@ -8,5 +8,4 @@ testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane stackDepths := swimlane allMorphs select: [:aSubmorph | aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph fullBounds width]. - self assert: 2 equals: stackDepths asSet size. - self assert: stackDepths first < stackDepths second. \ No newline at end of file + self assert: 2 equals: stackDepths asSet size. \ No newline at end of file diff --git a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/methodProperties.json b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/methodProperties.json index b5806cd4..dedc0e8f 100644 --- a/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/methodProperties.json +++ b/packages/Babylonian-Tests.package/BPPrintbuggerTest.class/methodProperties.json @@ -17,7 +17,7 @@ "testSwimlaneEmptyForNoProbes" : "jb 7/10/2021 17:44", "testTwoTraceValuesInDifferentMethodsGetDifferentColorsInMultipleSwimlanes" : "jb 11/20/2021 01:35", "testTwoTraceValuesInDifferentMethodsGetDifferentColorsInSameSwimlane" : "jb 11/20/2021 01:38", - "testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane" : "jb 11/20/2021 01:47", + "testTwoTraceValuesInDifferentMethodsGetDifferentStackDepthsInSameSwimlane" : "jb 11/20/2021 02:06", "testTwoTraceValuesInSameMethodGetSameColorInMultipleSwimlanes" : "jb 7/2/2021 00:31", "testTwoTraceValuesInSameMethodGetSameColorInSameSwimlane" : "jb 11/19/2021 21:50", "testUpdatesSwimlanesAfterDeactivatingExample" : "jb 7/2/2021 14:50",