The Trunk: Tools-eem.984.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tools-eem.984.mcz

commits-2
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.984.mcz

==================== Summary ====================

Name: Tools-eem.984
Author: eem
Time: 16 July 2020, 3:10:24.240422 pm
UUID: c9cea967-9685-4ce3-8eea-72da87f12be6
Ancestors: Tools-mt.983

Fix a regression in Tools-ct.952.
This fix constitutes a review of http://forum.world.st/BUG-in-Debugger-gt-gt-newStack-optimization-td5112726.html

=============== Diff against Tools-mt.983 ===============

Item was changed:
  ----- Method: Debugger>>newStack: (in category 'private') -----
  newStack: stack
+ | oldStack diff matchIndex |
- | oldStack diff |
  oldStack := contextStack.
  contextStack := stack.
+ (oldStack isNil or: [oldStack last ~~ stack last]) ifTrue:
+ [contextStackList := stack collect: [:ctx | ctx printString].
+ ^self].
- (oldStack == nil or: [oldStack last ~~ stack last])
- ifTrue: [contextStackList := contextStack collect: [:ctx | ctx printString].
- ^ self].
  "May be able to re-use some of previous list"
  diff := stack size - oldStack size.
  contextStackList := diff <= 0
+ ifTrue: [contextStackList copyFrom: 1 - diff to: oldStack size]
+ ifFalse:
+ [matchIndex := stack lastIndexOf: oldStack first startingAt: diff + 1.
+ matchIndex = 0
+ ifTrue: [contextStack collect: [:ctx | ctx printString]]
+ ifFalse: [((contextStack first: matchIndex - 1) collect: [:ctx| ctx printString]), contextStackList]]
+ "#(d e f h i) => #(a b c d e f g h i)
+ diff := 3.
+ matchIndex := 4.
+ #(a b c d e f g h i) := #(a b c), #(d e f h i)"!
- ifTrue: [contextStackList copyFrom: 1-diff to: oldStack size]
- ifFalse: [(diff = 1 and: [stack second == oldStack first])
- ifTrue: [contextStackList copyWithFirst: stack first printString]
- ifFalse: [contextStack collect: [:ctx | ctx printString]]]!