Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
taking a fresh approach to build stack frames ... TDRawStackFrame pro…
…vides basic access the stack frame contents with very little interpretation ... there is enough protocol present so that a TDRawStackFrame can be used in a TDDebugger. but I've got no client element support ... this class may migrate to the base image. TDTopazContext emulates the frame information displayed in topaz
- Loading branch information
1 parent
f4b6e80
commit 181236f
Showing
67 changed files
with
419 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ execBlockComplexScopedTemps | |
| a b | | ||
a := 1. | ||
b := 2. | ||
^ [ a halt ] | ||
^ [ | c | | ||
c := 3. | ||
[ a halt ] value ] |
2 changes: 1 addition & 1 deletion
2
...ry/Tode-GemStone-Server3x-Tests.package/TDStackFrameNewTests.class/instance/stackClass.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
private | ||
stackClass | ||
^ TDStackNew | ||
^ TDNewStack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
repository/Tode-GemStone-Server3x-Tests.package/monticello.meta/version
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
...tory/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/argAndTempNames.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
argAndTempNames | ||
^ argAndTempNames | ||
ifNil: [ argAndTempNames := (self frameContents at: 9) collect: [ :each | each asString ] ] |
3 changes: 3 additions & 0 deletions
3
...y/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/argAndTempNamesAt..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
argAndTempNamesAt: index | ||
^ self frameContents at: 10 + index |
5 changes: 5 additions & 0 deletions
5
...tory/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/argOrTempNamed..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
accessing | ||
argOrTempNamed: aString | ||
^ self | ||
argOrTempNamed: aString | ||
ifAbsent: [ self error: 'no arg or temp named: ' , aString printString ] |
7 changes: 7 additions & 0 deletions
7
...z-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/argOrTempNamed.ifAbsent..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
accessing | ||
argOrTempNamed: aString ifAbsent: absentBlock | ||
| index | | ||
index := self argAndTempNames indexOf: aString. | ||
index == 0 | ||
ifTrue: [ ^ absentBlock value ]. | ||
^ self argAndTempNamesAt: index |
11 changes: 11 additions & 0 deletions
11
...y/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/findFrameSuchThat..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
querying | ||
findFrameSuchThat: testBlock | ||
"Search self and my sender chain for first one that satisfies testBlock. Return nil if none satisfy" | ||
|
||
| frame | | ||
frame := self. | ||
[ frame isNil ] whileFalse: [ self frameContents ~~ nil | ||
ifTrue: [ (testBlock value: frame) | ||
ifTrue: [ ^ frame ] ]. | ||
frame := frame next ]. | ||
^ nil |
34 changes: 34 additions & 0 deletions
34
...sitory/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/frameContents.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
accessing | ||
frameContents | ||
"Private. Returns an Array describing the specified level in the receiver. | ||
aLevel == 1 is top of stack. If aLevel is less than 1 or greater than | ||
stackDepth, returns nil. | ||
The result Array contains: | ||
offset item | ||
----- ----- | ||
1 gsMethod (a GsNMethod) | ||
2 ipOffset (absolute instruction offset in portable code | ||
negative means a stack breakpoint is present) | ||
3 frameOffset (always nil , not compatible with Gs64 v2.x) | ||
4 varContext | ||
5 saveProtectedMode (always nil in v3.0) | ||
6 markerOrException (always nil in v3.0) | ||
7 homeMethod if gsMethod is for a block, otherwise nil . | ||
8 self (possibly nil in a ComplexBlock) | ||
9 argAndTempNames (an Array of Symbols or Strings) | ||
10 receiver | ||
11... arguments and temp values, if any" | ||
|
||
"Notes to GemStone implementors: | ||
If result of this method is changed, you must change tpaux.c in the | ||
topaz C sources, other methods in this class, and the code for primitive 195. | ||
Note that if execution stops at a breakpoint at the entry to a method, | ||
the method temporaries may not be allocated yet and so some or all of | ||
the method temporaries may be missing from the result." | ||
|
||
frameContents | ||
ifNil: [ frameContents := self process _frameContentsAt: self frameIndex ]. | ||
^ frameContents |
4 changes: 4 additions & 0 deletions
4
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/frameIndex..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
frameIndex: anInteger | ||
frameIndex := anInteger. | ||
self argAndTempNames |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/frameIndex.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
frameIndex | ||
^ frameIndex |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/frameSelf.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
frameSelf | ||
^ self frameContents at: 8 |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/gsMethod.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
gsMethod | ||
^ self frameContents at: 1 |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/homeMethod.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
homeMethod | ||
^ (self frameContents at: 7) ifNil: [ self gsMethod homeMethod ] |
4 changes: 4 additions & 0 deletions
4
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/inClass.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
inClass | ||
self gsMethod ifNil: [ ^ nil ]. | ||
^ self homeMethod ifNotNil: [ :hm | hm inClass ] |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/ipOffset.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
ipOffset | ||
^ self frameContents at: 2 |
4 changes: 4 additions & 0 deletions
4
...ory/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/isMethodForBlock.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
testing | ||
isMethodForBlock | ||
self gsMethod ifNil: [ ^ false ]. | ||
^ self gsMethod isMethodForBlock |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/next..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
next: aFrame | ||
next := aFrame |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/next.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
next | ||
^ next |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/previous..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
previous: aFrame | ||
previous := aFrame |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/previous.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
previous | ||
^ previous |
25 changes: 25 additions & 0 deletions
25
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/printOn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
printing | ||
printOn: aStream | ||
| theSelf | | ||
self frameContents ifNil: [ ^ aStream nextPutAll: '..bad frame...' ]. | ||
self isMethodForBlock | ||
ifTrue: [ aStream nextPutAll: '[] in ' ]. | ||
self inClass == nil | ||
ifTrue: [ aStream nextPutAll: 'Executed Code'. | ||
^ self ]. | ||
theSelf := self theSelf. | ||
theSelf class ~= self inClass | ||
ifTrue: [ aStream | ||
nextPutAll: theSelf class name asString; | ||
nextPutAll: '(' , self inClass name asString , ')' ] | ||
ifFalse: [ aStream nextPutAll: self inClass name asString ]. | ||
aStream nextPutAll: '>>'. | ||
aStream nextPutAll: self selector. | ||
(self process respondsTo: #'_localStepPointStringAt:') | ||
ifTrue: [ aStream | ||
nextPutAll: | ||
' ' , (self process perform: #'_localStepPointStringAt:' with: self frameIndex) ] | ||
ifFalse: [ (self process respondsTo: #'_stepPointStringAt:') | ||
ifTrue: [ aStream | ||
nextPutAll: | ||
' ' , (self process perform: #'_stepPointStringAt:' with: self frameIndex) ] ] |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/process.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
process | ||
^ self stack process |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/receiver.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
receiver | ||
^ self frameContents at: 10 |
4 changes: 4 additions & 0 deletions
4
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/selector.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
selector | ||
self gsMethod ifNil: [ ^ #'' ]. | ||
^ self homeMethod selector |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/stack..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
stack: aTDStack | ||
stack := aTDStack |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/stack.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
stack | ||
^ stack |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/theSelf.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
theSelf | ||
^ self frameSelf ifNil: [ self argOrTempNamed: 'self' ifAbsent: [ ] ] |
3 changes: 3 additions & 0 deletions
3
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/instance/varContext.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
varContext | ||
^ self frameContents at: 4 |
30 changes: 30 additions & 0 deletions
30
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"argAndTempNames" : "dkh 12/30/2016 04:12", | ||
"argAndTempNamesAt:" : "dkh 12/30/2016 04:05", | ||
"argOrTempNamed:" : "dkh 12/30/2016 04:06", | ||
"argOrTempNamed:ifAbsent:" : "dkh 12/30/2016 04:06", | ||
"findFrameSuchThat:" : "dkh 12/30/2016 04:48", | ||
"frameContents" : "dkh 12/30/2016 04:17", | ||
"frameIndex" : "dkh 12/30/2016 04:07", | ||
"frameIndex:" : "dkh 12/30/2016 04:48", | ||
"frameSelf" : "dkh 12/30/2016 04:15", | ||
"gsMethod" : "dkh 12/30/2016 04:16", | ||
"homeMethod" : "dkh 12/30/2016 04:36", | ||
"inClass" : "dkh 12/30/2016 04:33", | ||
"ipOffset" : "dkh 12/30/2016 04:14", | ||
"isMethodForBlock" : "dkh 12/30/2016 04:22", | ||
"next" : "dkh 12/30/2016 04:22", | ||
"next:" : "dkh 12/30/2016 04:22", | ||
"previous" : "dkh 12/30/2016 04:23", | ||
"previous:" : "dkh 12/30/2016 04:23", | ||
"printOn:" : "dkh 12/30/2016 04:32", | ||
"process" : "dkh 12/30/2016 04:26", | ||
"receiver" : "dkh 12/30/2016 04:16", | ||
"selector" : "dkh 12/30/2016 04:34", | ||
"stack" : "dkh 12/30/2016 04:26", | ||
"stack:" : "dkh 12/30/2016 04:45", | ||
"theSelf" : "dkh 12/30/2016 04:31", | ||
"varContext" : "dkh 12/30/2016 04:15" } } |
19 changes: 19 additions & 0 deletions
19
repository/Topez-Server-3x-DebugTools.package/TDRawStackFrame.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"category" : "Topez-Server-3x-DebugTools", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"stack", | ||
"argAndTempNames", | ||
"frameIndex", | ||
"frameContents", | ||
"next", | ||
"previous" ], | ||
"name" : "TDRawStackFrame", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"type" : "normal" } |
1 change: 1 addition & 0 deletions
1
repository/Topez-Server-3x-DebugTools.package/TDTopazContext.class/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
display the same frame context fields as topaz |
18 changes: 18 additions & 0 deletions
18
repository/Topez-Server-3x-DebugTools.package/TDTopazContext.class/class/initialize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
initialization | ||
initialize | ||
"builder: | ||
#view - normal view (i.e., collection of associations for Dictionary) | ||
#inspect - raw object/implementation view | ||
editor: | ||
#edit - text code editor (falls back to #navigate) | ||
#navigate - structural access via navigator | ||
CUSTOM - custom names for specialized window access" | ||
|
||
TDTopezServer | ||
registerEditorClass: TDStackFrameContentsClientListElementBuilder | ||
for: self | ||
aspect: #'contents'; | ||
registerEditorClass: TDStackFrameMethodElementBuilder | ||
for: self | ||
aspect: #'source' |
5 changes: 5 additions & 0 deletions
5
repository/Topez-Server-3x-DebugTools.package/TDTopazContext.class/instance/blockSelf.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
synthetic fields | ||
blockSelf | ||
(self receiver isKindOf: ExecBlock) | ||
ifTrue: [ ^ self receiver selfValue ]. | ||
^ nil |
11 changes: 11 additions & 0 deletions
11
...pez-Server-3x-DebugTools.package/TDTopazContext.class/instance/calculateSelectionRange.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
private | ||
calculateSelectionRange | ||
| method stepPoint begin end | | ||
method := self gsMethod. | ||
stepPoint := method | ||
_stepPointForIp: self ipOffset | ||
level: self frameIndex | ||
useNext: self process _nativeStack. | ||
begin := method _sourceOffsetsAt: stepPoint. | ||
end := self calculateSourceRangeEnd: begin in: method sourceString. | ||
^ begin to: end |
58 changes: 58 additions & 0 deletions
58
...Server-3x-DebugTools.package/TDTopazContext.class/instance/calculateSourceRangeEnd.in..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
private | ||
calculateSourceRangeEnd: start in: string | ||
| scan i char characterStack beginners enders | | ||
i := start. | ||
(string at: i) = $^ | ||
ifTrue: [ ^ string size - 1 ]. | ||
(char := string at: i) isCompilerSpecial | ||
ifTrue: [ | ||
^ (i < string size and: [ (char := string at: i + 1) isCompilerSpecial ]) | ||
ifTrue: [ i + 1 ] | ||
ifFalse: [ i ] ]. | ||
scan := true. | ||
[ scan ] | ||
whileTrue: [ | ||
[ i <= string size and: [ (string at: i) isSeparator ] ] whileTrue: [ i := i + 1 ]. | ||
[ i <= string size and: [ (char := string at: i) isAlphaNumeric or: [ char = $_ ] ] ] | ||
whileTrue: [ i := i + 1 ]. | ||
char = $: | ||
ifFalse: [ ^ i - 1 ]. | ||
scan := start == 1. | ||
scan | ||
ifTrue: [ i := i + 1 ] ]. | ||
characterStack := OrderedCollection new. | ||
beginners := String | ||
with: $' | ||
with: $" | ||
with: $( | ||
with: $[. | ||
enders := String with: $) with: $]. | ||
[ | ||
i := i + 1. | ||
i < string size ] | ||
whileTrue: [ | ||
char := string at: i. | ||
characterStack isEmpty | ||
ifTrue: [ | ||
(char = $. or: [ char = $; ]) | ||
ifTrue: [ ^ i - 1 ]. | ||
(beginners includes: char) | ||
ifTrue: [ characterStack addLast: char ] | ||
ifFalse: [ | ||
(enders includes: char) | ||
ifTrue: [ ^ i - 1 ] ] ] | ||
ifFalse: [ | ||
(characterStack last = $' or: [ characterStack last = $" ]) | ||
ifTrue: [ | ||
char = characterStack last | ||
ifTrue: [ characterStack removeLast ] ] | ||
ifFalse: [ | ||
(beginners includes: char) | ||
ifTrue: [ characterStack addLast: char ] | ||
ifFalse: [ | ||
(characterStack last = $( and: [ char = $) ]) | ||
ifTrue: [ characterStack removeLast ] | ||
ifFalse: [ | ||
(characterStack last = $[ and: [ char = $] ]) | ||
ifTrue: [ characterStack removeLast ] ] ] ] ] ]. | ||
^ i - 1 |
Oops, something went wrong.