Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a55b5e8
Window types, window activity periods, window opening source events (…
StevenCostiou Dec 7, 2023
eeaf83f
window jumps
StevenCostiou Dec 7, 2023
f22d5b7
model improvements
StevenCostiou Dec 12, 2023
3971810
active periods and windows timeline
StevenCostiou Dec 12, 2023
52510b9
Lost changes
StevenCostiou Jan 31, 2024
82dd79d
removing deprecated undeclared
StevenCostiou Jan 31, 2024
4ea523d
navgation between window events
StevenCostiou Jan 31, 2024
ae4766f
Heuristic to calculate the source event of a debugger opening
StevenCostiou Feb 5, 2024
5ed2ff2
moving extended model used for analysis under correct tag
StevenCostiou Feb 5, 2024
3ca7a3a
window id for window activity records
StevenCostiou Feb 5, 2024
cb9c36a
filtered window jump accessor
StevenCostiou Feb 12, 2024
533dd0a
Improving the window type to detect application windows
StevenCostiou Feb 14, 2024
a59b334
Adding filtered windows to remove framework-related windows
StevenCostiou Feb 14, 2024
166a82e
Improving printing of window records
StevenCostiou Feb 14, 2024
ca1e4bb
Added total time accessor on window records
StevenCostiou Feb 14, 2024
8ef1351
Better printing of window activity records and duration accessor
StevenCostiou Feb 14, 2024
7323f4a
Recategorizing method
StevenCostiou Feb 14, 2024
3d0d3fa
Recomputing window id for logs without id or with erroneous id, bette…
StevenCostiou Feb 14, 2024
1313862
helpers
StevenCostiou Feb 14, 2024
0fe0948
Fixing log
StevenCostiou Feb 14, 2024
1b8b56e
Added window logs sequences validation
StevenCostiou Feb 14, 2024
bef912d
removing halts
StevenCostiou Feb 14, 2024
1ae506b
More precision in window id fixing heuristic
StevenCostiou Feb 14, 2024
9039960
Adding explicit unknown window to window types.
StevenCostiou Feb 14, 2024
df711c0
Computing window jumps based on filtered windows instead of windows
StevenCostiou Feb 14, 2024
3ca57e5
missing accessors
StevenCostiou Feb 14, 2024
931a344
Stepping record for analysis
StevenCostiou Feb 19, 2024
8842f68
removing halt
StevenCostiou Feb 20, 2024
31d4ae5
class error
StevenCostiou Feb 20, 2024
c0fc7d5
class error
StevenCostiou Feb 20, 2024
3133f87
delegation to original event
StevenCostiou Feb 20, 2024
dfbaa19
replacing all generic steps by hierarchical step structure
StevenCostiou Feb 20, 2024
963805a
Breakpoint hierarchy evenet model
StevenCostiou Feb 20, 2024
a3f9b7e
fixing log event name for clarity
StevenCostiou Feb 20, 2024
5ced0b7
Merging contiguous window jumps
StevenCostiou Feb 20, 2024
8261a39
Renaming and accessor for merged window jumps
StevenCostiou Feb 20, 2024
64640a0
Breakpoint reporting
StevenCostiou Feb 20, 2024
e0016f1
Abstraction for breakpoint report
StevenCostiou Feb 20, 2024
8c267ac
Halt report
StevenCostiou Feb 20, 2024
6257183
Test for 1 halt
StevenCostiou Feb 28, 2024
0509c3c
We need to keep the nil windows, for example halts and breakpoints ha…
StevenCostiou Feb 28, 2024
d783af1
The breakpoints have changed
StevenCostiou Feb 28, 2024
d39f2b3
Recording breakpoints hash to know which is which in the logs
StevenCostiou Feb 28, 2024
3541e8d
Reclassification
StevenCostiou Feb 28, 2024
8e43cf0
Capturing exceptions + tests
StevenCostiou Feb 28, 2024
463f480
Fixing namings in windows
StevenCostiou Mar 4, 2024
6a07b2d
Merge 8e43cf03a6a0afa1e303eae2190ce963375b7462
StevenCostiou Mar 4, 2024
19678b3
Improvments and bug fixes
StevenCostiou Mar 5, 2024
e97f761
Debugging code and missing details
StevenCostiou Jul 23, 2024
2b5a3f0
Add annotation to the model
ValentinBourcier Sep 27, 2024
c7455f7
Merge branch 'P12' into P11
StevenCostiou Mar 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions DebuggingSpy-Tests/DSSpyInstrumenterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ DSSpyInstrumenterTest >> debuggerWithRunnableContext [
initialize
]

{ #category : 'helpers' }
DSSpyInstrumenterTest >> execute1Halt [
1 halt
]

{ #category : 'helpers' }
DSSpyInstrumenterTest >> executeHalt [

Expand Down Expand Up @@ -227,6 +232,18 @@ DSSpyInstrumenterTest >> metaPaneClassesItems: listName FromInspector: aMetaPane
^ (aMetaPane class slotNamed: listName) read: aMetaPane
]

{ #category : 'helpers' }
DSSpyInstrumenterTest >> methodWithDNU [

self unknownMessage
]

{ #category : 'helpers' }
DSSpyInstrumenterTest >> methodWithException [

Exception new signal
]

{ #category : 'helpers' }
DSSpyInstrumenterTest >> newInspectorOn: anObject [

Expand Down Expand Up @@ -653,6 +670,14 @@ DSSpyInstrumenterTest >> testInstrumentHaltHits [
record := self registry fourth.
self assert: record selector equals: #now:.
self assertHaltHitRecordingMethod: (self class >> #executeHaltWithMessage) conditional: false once: false.

[ self execute1Halt ]
on: Halt
do: [ ].
self assert: self registry size equals: 5.
record := self registry fifth.
self assert: record selector equals: #halt.
self assertHaltHitRecordingMethod: (self class >> #execute1Halt) conditional: false once: false.
]

{ #category : 'tests - halts' }
Expand Down Expand Up @@ -1316,3 +1341,42 @@ DSSpyInstrumenterTest >> testLoggingInteractionsWithNoSourceCode [
assert: record selectedString
equals: DSSpy recordSourceCodeDisabledErrorMessage ]
]

{ #category : #'tests - exceptions' }
DSSpyInstrumenterTest >> testRecordDNU [
|capturedDNU|

modifiedClass := Exception.
modifiedMethodSource := (Exception >> #raiseUnhandledError) sourceCode.
instrumenter instrumentExceptionSignalling.

[self methodWithDNU] on: MessageNotUnderstood do:[:dnu| capturedDNU := dnu. [dnu raiseUnhandledError] on: UnhandledError do:[] ].

record := self registry first.
self assert: record class equals: DSUnhandledExceptionRecord.
self assert: record exceptionClass equals: MessageNotUnderstood name.
self assert: record errorString equals: capturedDNU description.
self assert: record receiver equals: self class name.
self assert: record node equals: (self class>>#methodWithDNU) ast children first sourceCode.
self assert: record method equals: (self class>>#methodWithDNU) selector
]

{ #category : #'tests - exceptions' }
DSSpyInstrumenterTest >> testRecordException [
|capturedException|

modifiedClass := Exception.
modifiedMethodSource := (Exception >> #raiseUnhandledError) sourceCode.
instrumenter instrumentExceptionSignalling.

[self methodWithException] on: Exception do:[:e| capturedException := e copy. [e raiseUnhandledError] on: UnhandledError do:[] ].

self assert: self registry size equals: 1.
record := self registry first.
self assert: record class equals: DSUnhandledExceptionRecord.
self assert: record exceptionClass equals: Exception name.
self assert: record errorString equals: capturedException description.
self assert: record receiver equals: self class name.
self assert: record node equals: (self class>>#methodWithException) ast children first sourceCode.
self assert: record method equals: (self class>>#methodWithException) selector
]
17 changes: 12 additions & 5 deletions DebuggingSpy-Tests/DSSpyTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Class {
'breakpoint',
'task',
'survey',
'recordSourceCode'
'recordSourceCode',
'breakpointHash'
],
#category : 'DebuggingSpy-Tests',
#package : 'DebuggingSpy-Tests'
Expand All @@ -26,7 +27,8 @@ DSSpyTest >> assertBreakpointRecordedAs: aDSRecordClass forBreakpointEvent: aBre
ifNotNil: [self assert: record objectCentric].
self deny: record once.
self assert: record method equals: self breakpointedMethod name.
self assert: record node equals: self breakpointedMethod ast printString
self assert: record node equals: self breakpointedMethod ast printString.
self assert: record breakpointHash equals: breakpointHash
]

{ #category : 'assertions' }
Expand Down Expand Up @@ -68,7 +70,8 @@ DSSpyTest >> assertVariableBreakpointRecordedAs: aDSRecordClass forBreakpointEve
self deny: record once.
self assert: record targetClassOrMethod equals: self breakpointedMethod name.
self assert: record targetVariables first equals: #value.
self assert: record accessStrategy equals: #all
self assert: record accessStrategy equals: #all.
self assert: record breakpointHash equals: breakpointHash
]

{ #category : 'assertions' }
Expand Down Expand Up @@ -114,15 +117,17 @@ DSSpyTest >> compileTestMethod [
DSSpyTest >> installBreakpoint [

breakpoint := Breakpoint new node: self breakpointedMethod ast.
breakpoint install
breakpoint install.
breakpointHash := breakpoint hash
]

{ #category : 'helpers' }
DSSpyTest >> installVariableBreakpoint [

breakpoint := VariableBreakpoint
watchVariable: #value
inClass: self breakpointedMethod
inClass: self breakpointedMethod.
breakpointHash := breakpoint hash
]

{ #category : 'helpers' }
Expand Down Expand Up @@ -531,6 +536,7 @@ DSSpyTest >> testObjectCentricBreakpointRecord [
instrumenter listenToBreakpointChanges.

breakpoint := target haltOnCallTo: #breakpointMethod.
breakpointHash := breakpoint hash.
self assert: self registry size equals: 1.
record := self registry first.
self
Expand Down Expand Up @@ -566,6 +572,7 @@ DSSpyTest >> testObjectCentricVariableBreakpointRecord [
breakpoint := (self breakpointedMethod newBreakpointForVariable: #value)
scopeTo: target;
install.
breakpointHash := breakpoint hash.

self assert: self registry size equals: 1.
record := self registry first.
Expand Down
33 changes: 31 additions & 2 deletions DebuggingSpy/DSAbstractBreakpointEventRecord.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,46 @@ Class {
'target',
'objectCentric',
'eventName',
'once'
'once',
'breakpointHash'
],
#category : 'DebuggingSpy-Records',
#package : 'DebuggingSpy',
#tag : 'Records'
}



{ #category : 'converting' }
DSAbstractBreakpointEventRecord >> asBreakpointRecord [

^ self modelClass
perform: eventName asLowercase asSymbol asMutator
with: self
]

{ #category : 'accessing' }
DSAbstractBreakpointEventRecord >> breakpointHash [
^breakpointHash
]

{ #category : 'testing' }
DSAbstractBreakpointEventRecord >> canOpenDebuggers [
^eventName = 'BreakpointHit'
]

{ #category : 'accessing' }
DSAbstractBreakpointEventRecord >> eventName [
^eventName
]


{ #category : 'converting' }
DSAbstractBreakpointEventRecord >> modelClass [

^ self subclassResponsibility
]

{ #category : 'accessing' }
DSAbstractBreakpointEventRecord >> objectCentric [

Expand Down Expand Up @@ -55,7 +83,8 @@ DSAbstractBreakpointEventRecord >> record: aBreakpointEvent [
self printTargetInstance:
aBreakpointEvent breakpoint targetInstance ]
ifFalse: [ nil ].
once := aBreakpointEvent breakpoint once
once := aBreakpointEvent breakpoint once.
breakpointHash := aBreakpointEvent breakpoint hash
]

{ #category : 'accessing' }
Expand Down
17 changes: 17 additions & 0 deletions DebuggingSpy/DSAbstractEventRecord.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ DSAbstractEventRecord >> >= aDSAbstractRecord [
^self dateTime >= aDSAbstractRecord dateTime
]


{ #category : 'testing' }
DSAbstractEventRecord >> canOpenDebuggers [

^ true
]

{ #category : 'accessing' }
DSAbstractEventRecord >> dateTime [

Expand Down Expand Up @@ -83,6 +90,11 @@ DSAbstractEventRecord >> printOn: aStream [
aStream << self eventName
]

{ #category : 'accessing' }
DSAbstractEventRecord >> realRecord [
^self
]

{ #category : 'actions api' }
DSAbstractEventRecord >> record: aWindow [
windowId := aWindow identityHash
Expand Down Expand Up @@ -110,3 +122,8 @@ DSAbstractEventRecord >> windowId: anObject [

windowId := anObject
]

{ #category : #accessing }
DSAbstractEventRecord >> windowType [
^'Unknown Window'
]
39 changes: 39 additions & 0 deletions DebuggingSpy/DSAbstractExtendedRecord.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Class {
#name : #DSAbstractExtendedRecord,
#superclass : #DSAbstractEventRecord,
#instVars : [
'sourceRecord'
],
#category : #'DebuggingSpy-Records-Extensions'
}

{ #category : #'instance creation' }
DSAbstractExtendedRecord class >> for: anObject [

^ self new
record: anObject;
yourself
]

{ #category : #'actions api' }
DSAbstractExtendedRecord >> dateTime [

^ sourceRecord dateTime
]

{ #category : #accessing }
DSAbstractExtendedRecord >> realRecord [

^ sourceRecord
]

{ #category : #'actions api' }
DSAbstractExtendedRecord >> record: aSourceRecord [
sourceRecord := aSourceRecord
]

{ #category : #'actions api' }
DSAbstractExtendedRecord >> windowId [

^ sourceRecord windowId
]
10 changes: 10 additions & 0 deletions DebuggingSpy/DSBreakpointAdd.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Class {
#name : #DSBreakpointAdd,
#superclass : #DSMethodBreakpointRecord,
#category : #'DebuggingSpy-Records-Extensions'
}

{ #category : #'as yet unclassified' }
DSBreakpointAdd >> eventSymbol [
^'+b'
]
6 changes: 6 additions & 0 deletions DebuggingSpy/DSBreakpointEventRecord.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ DSBreakpointEventRecord >> method [
^ method
]

{ #category : 'converting' }
DSBreakpointEventRecord >> modelClass [

^ DSMethodBreakpointRecord
]

{ #category : 'accessing' }
DSBreakpointEventRecord >> node [

Expand Down
10 changes: 10 additions & 0 deletions DebuggingSpy/DSBreakpointHit.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Class {
#name : #DSBreakpointHit,
#superclass : #DSMethodBreakpointRecord,
#category : #'DebuggingSpy-Records-Extensions'
}

{ #category : #'as yet unclassified' }
DSBreakpointHit >> eventSymbol [
^'*b'
]
75 changes: 75 additions & 0 deletions DebuggingSpy/DSBreakpointRecord.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Class {
#name : #DSBreakpointRecord,
#superclass : #DSAbstractExtendedRecord,
#category : #'DebuggingSpy-Records-Extensions'
}

{ #category : #accessing }
DSBreakpointRecord >> breakpointHash [

^ sourceRecord breakpointHash
]

{ #category : #testing }
DSBreakpointRecord >> canOpenDebuggers [

^ sourceRecord canOpenDebuggers
]

{ #category : #accessing }
DSBreakpointRecord >> eventName [

^ sourceRecord eventName
]

{ #category : #'as yet unclassified' }
DSBreakpointRecord >> eventSymbol [
^self subclassResponsibility
]

{ #category : #accessing }
DSBreakpointRecord >> objectCentric [

^ sourceRecord objectCentric
]

{ #category : #accessing }
DSBreakpointRecord >> once [

^ sourceRecord once
]

{ #category : #printing }
DSBreakpointRecord >> printContextAndNode [

^ String streamContents: [ :s |
| nodeStream peek |
s << '['.
s << self eventName.
s << ']'.
s space.
s << self method]
]

{ #category : #printing }
DSBreakpointRecord >> printTargetInstance: anObject [
^sourceRecord printTargetInstance: anObject
]

{ #category : #accessing }
DSBreakpointRecord >> submethodTargets [

^ self subclassResponsibility
]

{ #category : #accessing }
DSBreakpointRecord >> target [

^ sourceRecord target
]

{ #category : #accessing }
DSBreakpointRecord >> targetClassOrMethod [

^ self subclassResponsibility
]
Loading
Loading