Skip to content

Commit

Permalink
fix debug points to be able to set a variable breakpoint, scoped to a…
Browse files Browse the repository at this point in the history
… subclass (excluding all accesses in brother/cousin classes)
  • Loading branch information
adri09070 committed Apr 30, 2024
1 parent 17e5ada commit 372702a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
27 changes: 14 additions & 13 deletions src/DebugPoints/DebugPoint.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,6 @@ DebugPoint >> install [
self target install: self link
]

{ #category : 'API' }
DebugPoint >> instanceVariable: aSlot accessStrategy: aSymbol [

target := DebugPointInstanceVariableTarget new
instanceVariable: aSlot;
accessStrategy: aSymbol;
yourself.

name := 'var_{1}_{2}' format: {
aSlot name.
aSymbol }
]

{ #category : 'accessing' }
DebugPoint >> link [
^metaLink
Expand Down Expand Up @@ -374,6 +361,20 @@ DebugPoint >> targetClass [
^ self target targetClass
]

{ #category : 'API' }
DebugPoint >> targetClass: aClass instanceVariable: aSlot accessStrategy: aSymbol [

target := DebugPointInstanceVariableTarget new
targetClass: aClass;
instanceVariable: aSlot;
accessStrategy: aSymbol;
yourself.

name := 'var_{1}_{2}' format: {
aSlot name.
aSymbol }
]

{ #category : 'scope' }
DebugPoint >> targetInstance: anObject [

Expand Down
11 changes: 9 additions & 2 deletions src/DebugPoints/DebugPointInstanceVariableTarget.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Class {
#name : 'DebugPointInstanceVariableTarget',
#superclass : 'DebugPointClassTarget',
#instVars : [
'accessStrategy'
'accessStrategy',
'targetClass'
],
#category : 'DebugPoints-Implementations',
#package : 'DebugPoints',
Expand Down Expand Up @@ -110,5 +111,11 @@ DebugPointInstanceVariableTarget >> removeFromMethod: aMethod for: aDebugPoint [
{ #category : 'accessing' }
DebugPointInstanceVariableTarget >> targetClass [

^ self instanceVariable owningClass
^ targetClass ifNil: [ targetClass := self instanceVariable owningClass ]
]

{ #category : 'accessing' }
DebugPointInstanceVariableTarget >> targetClass: anObject [

^ targetClass := anObject
]
4 changes: 3 additions & 1 deletion src/DebugPoints/DebugPointManager.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ DebugPointManager class >> installNew: aDebugPointClass forObject: anObject onVa
| dp instanceVariable |
instanceVariable := anObject class slotNamed: aSlotNameSymbol.
dp := aDebugPointClass new
targetClass: anObject class
instanceVariable: instanceVariable
accessStrategy: anAccessStrategySymbol;
targetInstance: anObject;
Expand Down Expand Up @@ -217,7 +218,8 @@ DebugPointManager class >> installNew: aDebugPointClass inClass: aClass onVariab
| dp instanceVariable |
instanceVariable := aClass lookupVar: aSlotNameSymbol.
dp := aDebugPointClass new
instanceVariable: instanceVariable
targetClass: aClass
instanceVariable: instanceVariable
accessStrategy: anAccessStrategySymbol;
yourself.

Expand Down

0 comments on commit 372702a

Please sign in to comment.