Skip to content

Commit

Permalink
Remove some dead code in DebugSession
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed Jan 17, 2025
1 parent 4eb53e4 commit 0e806d6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 57 deletions.
56 changes: 0 additions & 56 deletions src/Debugger-Model/DebugSession.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,6 @@ DebugSession >> selectedCodeRangeForContext: selectedContext [
^ self pcRangeForContext: selectedContext
]

{ #category : 'testing' }
DebugSession >> shouldDisplayContext: aContext basedOnFilters: stackFilters [
"Return true if all filters match the given context, or false otherwise.
True is returned if there are no filters."

^stackFilters allSatisfy: [ :aFilter | aFilter shouldDisplay: aContext ]
]

{ #category : 'logging' }
DebugSession >> signalDebuggerError: anError [

Expand All @@ -458,54 +450,6 @@ DebugSession >> stackOfSize: size [
^ interruptedContext stackOfSize: size
]

{ #category : 'accessing' }
DebugSession >> stackOfSize: limit usingFilters: stackFilters [
"Answer an OrderedCollection of the top 'limit' contexts on the receiver's sender chain, according to the given filters.
Consider the following stack:
a <-- top of the stack
b
a
c
a
b
d
e
a <-- bottom of the stack
If the given filters do not match context 'a' and 'b' the following stack will be returned:
a <-- top of the stack
b
a
c
d
e <-- bottom of the stack
First all consecutive contexts starting from the top of the stack for which a filter does not match are
added to the result (a b a in the example). Then from the remaining stack only the context for which all
filters match are added to the result.
"

| stack context |
stack := OrderedCollection new.
context := interruptedContext.

"Starting from the top of the stack add all consecutive contexts that should not be displayed."
[ context ~~ nil
and: [(stack size < limit)
and: [ (self shouldDisplayContext: context basedOnFilters: stackFilters) not ] ] ] whileTrue: [
stack addLast: context.
context := context sender ].

"Add all contexts that should be displayed. (the current context is checked again)"
[context ~~ nil
and: [stack size < limit ] ] whileTrue: [
(self shouldDisplayContext: context basedOnFilters: stackFilters)
ifTrue: [ stack addLast: context ].
context := context sender ].
^ stack
]

{ #category : 'debugging actions' }
DebugSession >> stepInto [

Expand Down
2 changes: 1 addition & 1 deletion src/ReleaseTests/ReleaseTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ ReleaseTest >> testThatThereAreNoSelectorsRemainingThatAreSentButNotImplemented
'AthensPolygon>>#paintFillsUsing:on:' 'BalloonEdgeData>>#stepToFirstScanLine' 'BalloonEdgeData>>#stepToNextScanLine'
'BalloonEngine>>#registerFills:' 'BalloonFillData>>#computeFill' 'ClyFullBrowserMorph>>#extendClassScopeForMethods:'
'ComplexBorderStyle>>#drawPolyPatchFrom:to:on:usingEnds:' 'ComplexBorderStyle>>#drawLineFrom:to:on:'
'Context>>#doPrimitive:method:receiver:args:' 'Context>>#failPrimitiveWith:' 'DebugSession>>#shouldDisplayContext:basedOnFilters:'
'Context>>#doPrimitive:method:receiver:args:' 'Context>>#failPrimitiveWith:'
'EDTest>>#prepareMethodVersionTest' 'ExternalDropHandler class>>#defaultHandler' 'FFICallbackArgumentReader>>#stackPointer'
'FFIFloat32>>#callbackReturnOn:for:' 'FFIFloatType>>#callbackReturnOn:for:' 'FFIIndirectFunctionResolution>>#resolveFunction:'
'OCIRReconstructor>>#fixPushNilsForTemps' 'IceTipHiedraAltComponentHistoryBrowser>>#newCommitRow:commit:'
Expand Down

0 comments on commit 0e806d6

Please sign in to comment.