-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Instance Probes #162
base: develop
Are you sure you want to change the base?
Add Instance Probes #162
Changes from all commits
0938dfa
0c0758f
e47ec04
8c847c6
0a4c68a
fd09757
17cac43
6a288f6
2bc6f0a
9536103
086a4d0
7a69c54
1105a35
f37c8cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
A Smalltalk implementation of the Babylonian Programming System. | ||
|
||
## How to install | ||
1. Get [a recent Squeak][squeakorg] | ||
1. Get [a recent trunk Squeak][squeakorg] | ||
2. Load [Metacello][metacello] | ||
3. Finally, load Babylonian/S with the following command: | ||
|
||
|
@@ -15,11 +15,6 @@ Metacello new | |
repository: 'github://hpi-swa-lab/babylonian-programming-smalltalk:main/packages'; | ||
load. | ||
``` | ||
4. (Recommended) Disable the preference for notifications on saving methods with styles. This prevents that you will be asked whether you want to save style information whenever you save a method with probes. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this intentional? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, i think the readme got a bit messed up when dev was merged |
||
|
||
```Smalltalk | ||
Preferences disable: #confirmFirstUseOfStyle. | ||
``` | ||
|
||
## Current State | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
private | ||
rewriteToSource: parseResult | ||
|
||
^ self rewriter value: parseResult |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
grammar rules | ||
AnnotatedKeywordMessageSend: aNode startTag: startTag actualMessage: message endTag: endTag | ||
|
||
^ self rewriteNode: message withTag: startTag | ||
^ self rewriteNode: message withTag: startTag |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
as yet unclassified | ||
rewrite rules | ||
bpTemporaryProbe: annotation with: originalExpressionSourceNode | ||
|
||
^ annotation instrumentationCallFor: (self value: originalExpressionSourceNode) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class initialization | ||
clear | ||
|
||
DefaultValue := nil |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
default | ||
|
||
^ DefaultValue ifNil: [DefaultValue := self new] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
actions | ||
addProbe: aProbe | ||
|
||
nameToProbesDict at: aProbe assignedClassName | ||
ifPresent: [:registeredProbes | registeredProbes add: aProbe] | ||
ifAbsent: [ | k | | ||
k := KeyedSet keyBlock: [ :each | each variableName ]. | ||
k add: aProbe. | ||
nameToProbesDict at: aProbe assignedClassName put: k] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
at: aClassName | ||
|
||
^ nameToProbesDict at: aClassName |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
initialize-release | ||
initialize | ||
|
||
super initialize. | ||
nameToProbesDict := Dictionary new. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
nameToProbesDict | ||
|
||
^ nameToProbesDict |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
actions | ||
removeProbe: aProbe | ||
|
||
nameToProbesDict at: aProbe assignedClassName | ||
ifPresent: [:registeredProbes | registeredProbes remove: aProbe. | ||
registeredProbes ifEmpty: | ||
[nameToProbesDict removeKey: aProbe assignedClassName]] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"class" : { | ||
"clear" : "joabe 9/28/2023 12:59", | ||
"default" : "joabe 9/28/2023 12:57" }, | ||
"instance" : { | ||
"addProbe:" : "joabe 10/5/2023 18:01", | ||
"at:" : "joabe 9/28/2023 15:08", | ||
"initialize" : "joabe 9/27/2023 16:33", | ||
"nameToProbesDict" : "joabe 9/28/2023 12:59", | ||
"removeProbe:" : "joabe 10/5/2023 17:47" } } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "Babylonian-Core-Tracing", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
"DefaultValue" ], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"nameToProbesDict" ], | ||
"name" : "BPClassNameToInstanceProbes", | ||
"pools" : [ | ||
], | ||
"super" : "DynamicVariable", | ||
"type" : "normal" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
constants | ||
annotationTag | ||
|
||
^ 'bpInstanceProbe' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
morphic | ||
asMorph | ||
|
||
| newMorph | | ||
newMorph := BPInstanceVariableProbeMorph new annotation: self; yourself. | ||
self updateTextAnchorPropertiesOf: newMorph. | ||
^ newMorph |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
assignedClassName: aString | ||
|
||
assignedClassName := aString |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
assignedClassName | ||
|
||
^ assignedClassName |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ui | ||
canBeAnnotatedTo | ||
|
||
^ #(stringLiteral) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
initialize-release | ||
deleteLinkedProbes | ||
|
||
| browser | | ||
browser := BPBrowser open. | ||
|
||
self linkedProbes do: [:aProbe | | ||
browser browseReference: aProbe methodReference. | ||
browser removeAnnotations: {aProbe}]. | ||
|
||
browser currentWindow delete. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initialize-release | ||
initialize | ||
|
||
super initialize. | ||
|
||
linkedProbes := OrderedCollection new. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
serialization | ||
instrumentationCallFor: actualEnclosedExpressionSource | ||
|
||
"Currently not used as instance probes do not rewrite a class definition in which they exist" | ||
^ '(self bpTraceVariable: [{1}] forProbe: {2} linked: \{{3}\} inContext: thisContext)' | ||
format: {actualEnclosedExpressionSource . | ||
self id. | ||
((self linkedProbes gather: [:probe | probe id]) joinSeparatedBy: ' . ')} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
testing | ||
isInstanceVariableProbe | ||
|
||
^ true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
linkedProbes | ||
|
||
^ linkedProbes |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
serialization | ||
probeTypeTag | ||
|
||
^ 'bpInstanceProbe' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
initialize-release | ||
removeFromMethod: aCompiledMethod | ||
|
||
"do nothing" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
variableName: aString | ||
|
||
self enclosedExpressionSource: aString |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
variableName | ||
|
||
^ self enclosedExpressionSource |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
wantsMetaClassIndication | ||
|
||
^ false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"class" : { | ||
"annotationTag" : "joabe 9/25/2023 17:30" }, | ||
"instance" : { | ||
"asMorph" : "joabe 10/6/2023 14:43", | ||
"assignedClassName" : "joabe 10/6/2023 14:40", | ||
"assignedClassName:" : "joabe 10/6/2023 14:40", | ||
"canBeAnnotatedTo" : "joabe 9/21/2023 21:08", | ||
"deleteLinkedProbes" : "joabe 10/6/2023 14:40", | ||
"initialize" : "joabe 10/4/2023 15:33", | ||
"instrumentationCallFor:" : "joabe 10/7/2023 18:25", | ||
"isInstanceVariableProbe" : "joabe 9/21/2023 21:18", | ||
"linkedProbes" : "joabe 10/4/2023 15:33", | ||
"probeTypeTag" : "joabe 9/25/2023 17:30", | ||
"removeFromMethod:" : "joabe 9/27/2023 16:43", | ||
"variableName" : "joabe 9/28/2023 14:47", | ||
"variableName:" : "joabe 9/28/2023 14:47", | ||
"wantsMetaClassIndication" : "joabe 9/21/2023 21:08" } } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"category" : "Babylonian-Core-Annotations", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"assignedClassName", | ||
"linkedProbes" ], | ||
"name" : "BPInstanceVariableProbe", | ||
"pools" : [ | ||
], | ||
"super" : "BPProbe", | ||
"type" : "normal" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
testing | ||
isInstanceVariableProbe | ||
|
||
^ false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
private | ||
allBabylonianInternalClasses | ||
^ #('Babylonian-Core' 'Babylonian-Compiler' 'Babylonian-UI' 'Babylonian-ProbeLog') | ||
inject: OrderedCollection new | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can use gather for this. :) |
||
into: [:theClasses :aPackage | | ||
theClasses, (PackageOrganizer default packageNamed: aPackage | ||
ifPresent: [:thePackage | thePackage classes] | ||
ifAbsent: [#()])]. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*Babylonian-Core | ||
bpExtractVariableAssignmentRangesNamed: aVariableName | ||
|
||
^ (self extractAssignmentIntervalsFrom: self parseTree named: aVariableName) flatten | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is trunk needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will revert this