Skip to content

Commit fa47dcd

Browse files
committed
Use new temp descriptors instead of binding objects
1 parent d4be746 commit fa47dcd

File tree

2 files changed

+105
-3
lines changed

2 files changed

+105
-3
lines changed

src/NewTools-Debugger/StDebuggerContext.class.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ StDebuggerContext >> buildInspectorNodes [
6060
nodes := OrderedCollection new.
6161
tempsAndArgs := self temporaryVariablesNodes.
6262
argsNodes := tempsAndArgs select: [ :tempNode |
63-
tempNode tempVariable isArgumentVariable ].
63+
tempNode isArgumentVariable ].
6464
tempsNodes := tempsAndArgs select: [ :tempNode |
65-
tempNode tempVariable isTempVariable ].
65+
tempNode isTempVariable ].
6666
nodes add: self selfNode.
6767
nodes addAll: argsNodes.
6868
nodes addAll: tempsNodes.
@@ -162,7 +162,7 @@ StDebuggerContext >> stackTopNode [
162162
StDebuggerContext >> temporaryVariablesNodes [
163163

164164
^ self context temporaryVariables collect: [ :temp |
165-
(StInspectorTempNode hostObject: self context) tempVariable: temp ]
165+
(StInspectorNewTempNode hostObject: self context) tempDescriptor: temp ]
166166
]
167167

168168
{ #category : 'nodes' }
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
"
2+
I am a variable node for representing a temporary variable stored in a Context object that has a name attached.
3+
This includes local variables and method parameters.
4+
"
5+
Class {
6+
#name : 'StInspectorNewTempNode',
7+
#superclass : 'StInspectorNode',
8+
#instVars : [
9+
'debugInfo',
10+
'tempDescriptor'
11+
],
12+
#category : 'NewTools-Inspector-Model',
13+
#package : 'NewTools-Inspector',
14+
#tag : 'Model'
15+
}
16+
17+
{ #category : 'comparing' }
18+
StInspectorNewTempNode >> = anObject [
19+
20+
"Answer whether the receiver and anObject represent the same object."
21+
22+
self == anObject ifTrue: [ ^ true ].
23+
self class = anObject class ifFalse: [ ^ false ].
24+
^ tempDescriptor = anObject name and: [
25+
hostObject = anObject hostObject ]
26+
]
27+
28+
{ #category : 'accessing' }
29+
StInspectorNewTempNode >> children [
30+
^ #()
31+
]
32+
33+
{ #category : 'accessing' }
34+
StInspectorNewTempNode >> debugInfo [
35+
36+
^ debugInfo
37+
]
38+
39+
{ #category : 'accessing' }
40+
StInspectorNewTempNode >> debugInfo: anObject [
41+
42+
debugInfo := anObject
43+
]
44+
45+
{ #category : 'comparing' }
46+
StInspectorNewTempNode >> hash [
47+
48+
"Answer an integer value that is related to the identity of the receiver."
49+
50+
^ tempDescriptor hash bitXor: (hostObject hash)
51+
]
52+
53+
{ #category : 'accessing' }
54+
StInspectorNewTempNode >> hostObject: aContext [
55+
56+
super hostObject: aContext.
57+
debugInfo := aContext method debugInfo.
58+
]
59+
60+
{ #category : 'accessing' }
61+
StInspectorNewTempNode >> isArgumentVariable [
62+
63+
^ tempDescriptor second
64+
]
65+
66+
{ #category : 'accessing' }
67+
StInspectorNewTempNode >> isTempVariable [
68+
69+
^ self isArgumentVariable not
70+
]
71+
72+
{ #category : 'accessing' }
73+
StInspectorNewTempNode >> key [
74+
^ tempDescriptor first
75+
]
76+
77+
{ #category : 'accessing' }
78+
StInspectorNewTempNode >> rawValue [
79+
"Answer the object value of this object variable (slot, indexed attribute, computed value)."
80+
81+
| scope |
82+
scope := (debugInfo debugScopeAt: (self hostObject executedPC max: self hostObject method initialPC)).
83+
^ scope readVariableNamed: tempDescriptor first at: self hostObject
84+
]
85+
86+
{ #category : 'accessing' }
87+
StInspectorNewTempNode >> tempDescriptor [
88+
89+
^ tempDescriptor
90+
]
91+
92+
{ #category : 'accessing' }
93+
StInspectorNewTempNode >> tempDescriptor: anObject [
94+
95+
tempDescriptor := anObject
96+
]
97+
98+
{ #category : 'accessing' }
99+
StInspectorNewTempNode >> variableTag [
100+
101+
^ 'temp. var'
102+
]

0 commit comments

Comments
 (0)