forked from pharo-project/pharo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StDebuggerContext.class.st
84 lines (73 loc) · 2.21 KB
/
StDebuggerContext.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
"
I am a simple wrapper holding the current context and the current debug session in a debugger.
My purpose is only to display context and debug session related information in the debugger inspector.
"
Class {
#name : #StDebuggerContext,
#superclass : #Object,
#instVars : [
'context',
'session',
'assertionContext',
'exceptionContext',
'debugger'
],
#category : #'NewTools-Debugger-Model'
}
{ #category : #'instance creation' }
StDebuggerContext class >> context: aContext session: aDebugSession debugger: sourceDebugger [
^ self new
context: aContext;
session: aDebugSession;
debugger: sourceDebugger;
yourself
]
{ #category : #accessing }
StDebuggerContext >> allInspectorNodes [
self flag: 'Removing the context from the inspected variables in the debugger. Should be added back as a debugger extension.'.
^ (self argumentsNodes) addAll: ({
(StDebuggerContextInspectorReceiverNode hostObject: self).
(StDebuggerContextInspectorTempsNode hostObject: self).
(StInspectorStackTopNode hostObject: self context)
"(StDebuggerContextInspectorContextNode hostObject: self)"}); yourself
]
{ #category : #accessing }
StDebuggerContext >> argumentsNodes [
| argNames |
argNames := self context sourceNode arguments.
^ (argNames collect: [ :argName |
(StInspectorTempNode hostObject: self context) tempVariable:
(self context temporaryVariableNamed: argName name) ])
asOrderedCollection
]
{ #category : #accessing }
StDebuggerContext >> assertionSelectors [
self flag: 'A bit magickal, also is this the right place?'.
^ #( #assert:equals: #assert:closeTo:precision:
#assert:closeTo: #assert:identicalTo: #assertCollection:equals:
#assertCollection:hasSameElements: )
]
{ #category : #accessing }
StDebuggerContext >> context [
^ context
]
{ #category : #accessing }
StDebuggerContext >> context: anObject [
context := anObject
]
{ #category : #accessing }
StDebuggerContext >> debugger: anObject [
debugger := anObject
]
{ #category : #printing }
StDebuggerContext >> printOn: aStream [
aStream nextPutAll: context asString
]
{ #category : #accessing }
StDebuggerContext >> session [
^ session
]
{ #category : #accessing }
StDebuggerContext >> session: anObject [
session := anObject
]