Skip to content

Commit 565fde8

Browse files
committed
- Implement #rangeForPC:contextIsActive: in CompiledCode, calling #debuggerMap
- implement versions on Context: pcRange, pcRangeContextIsActive: - push up #debuggerMap to CompiledCode - fix senders fixes pharo-project#4704
1 parent 979c579 commit 565fde8

File tree

8 files changed

+26
-19
lines changed

8 files changed

+26
-19
lines changed

src/Debugger-Model/DebugSession.class.st

+1-3
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,7 @@ DebugSession >> pcRangeForContext: aContext [
270270

271271
(aContext isNil or: [ aContext isDead ])
272272
ifTrue: [ ^ 1 to: 0 ].
273-
^ aContext debuggerMap
274-
rangeForPC: aContext pc
275-
contextIsActiveContext: (self isLatestContext: aContext)
273+
^ aContext pcRangeContextIsActive: (self isLatestContext: aContext)
276274
]
277275

278276
{ #category : #'debugging actions' }

src/Debugging-Core/CompiledBlock.extension.st

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
Extension { #name : #CompiledBlock }
22

3-
{ #category : #'*Debugging-Core' }
4-
CompiledBlock >> debuggerMap [
5-
^self compilerClass debuggerMethodMapForMethod: self.
6-
]
7-
83
{ #category : #'*Debugging-Core' }
94
CompiledBlock >> pcInOuter [
105
| outer end instructionStream |

src/Debugging-Core/CompiledCode.extension.st

+10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ CompiledCode >> abstractBytecodeMessagesFrom: startpc to: endpc do: aBlock [
4141
msgs"
4242
]
4343

44+
{ #category : #'*Debugging-Core' }
45+
CompiledCode >> debuggerMap [
46+
^self compilerClass debuggerMethodMapForMethod: self.
47+
]
48+
4449
{ #category : #'*Debugging-Core' }
4550
CompiledCode >> hasInstVarRef [
4651
self localHasInstVarRef ifTrue: [ ^ true ].
@@ -97,6 +102,11 @@ CompiledCode >> pcPreviousTo: pc [
97102
^prevPc
98103
]
99104

105+
{ #category : #'*Debugging-Core' }
106+
CompiledCode >> rangeForPC: aPC contextIsActive: contextIsActive [
107+
^self debuggerMap rangeForPC: aPC contextIsActiveContext: contextIsActive
108+
]
109+
100110
{ #category : #'*Debugging-Core' }
101111
CompiledCode >> symbolicBytecodes [
102112
"Answer Collection that contains of all the byte codes in a method as an instance of SymbolicInstruction"

src/Debugging-Core/CompiledMethod.extension.st

-6
This file was deleted.

src/Debugging-Core/Context.extension.st

+10
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ Context >> namedTempAt: index put: aValue [
5555
^self debuggerMap namedTempAt: index put: aValue in: self
5656
]
5757

58+
{ #category : #'*Debugging-Core' }
59+
Context >> pcRange [
60+
^self pcRangeContextIsActive: false
61+
]
62+
63+
{ #category : #'*Debugging-Core' }
64+
Context >> pcRangeContextIsActive: aBoolean [
65+
^self method rangeForPC: pc contextIsActive: aBoolean
66+
]
67+
5868
{ #category : #'*Debugging-Core' }
5969
Context >> previousPcWithCorrectMapping [
6070
"Answer a pc inside the enclosing block or mathod that is correctly mapped to an AST node"

src/OpalCompiler-Core/DebuggerMethodMapOpal.class.st

+1-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ DebuggerMethodMapOpal >> rangeForPC: aPC contextIsActiveContext: contextIsActive
6464
IR instruction, which means we can just go back one"
6565

6666
pc := contextIsActive ifTrue: [aPC] ifFalse: [aPC - 1].
67-
^(methodNode sourceNodeForPC: pc) debugHighlightRange
68-
67+
^(methodNode sourceNodeForPC: pc) debugHighlightRange
6968
]
7069

7170
{ #category : #public }

src/SystemCommands-RefactoringSupport/RBPushUpPreview.class.st

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ RBPushUpPreview >> classes [
7171
{ #category : #initialization }
7272
RBPushUpPreview >> initializeDropList [
7373
classDropList := self newDropList.
74-
classDropList displayBlock: [ :scope | scope name ];
74+
classDropList
75+
display: [ :scope | scope name ];
7576
iconBlock: [ :e | e systemIcon ]
7677
]
7778

src/Tool-ProcessBrowser/ProcessBrowser.class.st

+2-2
Original file line numberDiff line numberDiff line change
@@ -809,9 +809,9 @@ ProcessBrowser >> pcRange [
809809
the selected context's program counter value."
810810
(selectedContext isNil or: [methodText isEmptyOrNil])
811811
ifTrue: [^ 1 to: 0].
812-
^selectedContext debuggerMap
812+
^selectedContext method
813813
rangeForPC: (selectedContext pc ifNotNil: [:pc| pc] ifNil: [selectedContext method endPC])
814-
contextIsActiveContext: stackListIndex = 1
814+
contextIsActive: stackListIndex = 1
815815
]
816816

817817
{ #category : #'process list' }

0 commit comments

Comments
 (0)