Skip to content

Commit

Permalink
Extract Halt from Kernel + Remove obsolete dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed May 24, 2019
1 parent c48d7a7 commit e1ff41f
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 67 deletions.
2 changes: 2 additions & 0 deletions src/BaselineOfIDE/BaselineOfIDE.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ BaselineOfIDE >> baseline: spec [

spec baseline: 'Clap' with: [ spec repository: repository ].

spec package: 'Debug-Utils'.
spec package: 'ReleaseTests'.
spec package: 'Refactoring-Critics'.
spec package: 'NautilusRefactoring'.
Expand Down Expand Up @@ -391,6 +392,7 @@ BaselineOfIDE >> baseline: spec [
BaselineOfIDE >> groups: spec [

spec group: 'Mandatory-Group' with: #(
'Debug-Utils'
'Fuel-Tools-Pharo' "required by GT-Debugger HudsonBuildTools20"
'Network-Tests' "required by Multilingual-Tests"
'Gofer-Tests' "required by EpiceaTests Metacello-TestsMC, depends on 'Metacello-Tests-Group', cleanup needed?"
Expand Down
2 changes: 1 addition & 1 deletion src/Kernel/Halt.class.st → src/Debug-Utils/Halt.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Halt resetOnce
Class {
#name : #Halt,
#superclass : #Exception,
#category : #'Kernel-Exceptions'
#category : #'Debug-Utils'
}

{ #category : #halting }
Expand Down
60 changes: 60 additions & 0 deletions src/Debug-Utils/Object.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Extension { #name : #Object }

{ #category : #'*Debug-Utils' }
Object >> halt [
"This is the typical message to use for inserting breakpoints during debugging."
<debuggerCompleteToSender>
Halt now
]

{ #category : #'*Debug-Utils' }
Object >> halt: aString [
<debuggerCompleteToSender>
Halt now: aString
]

{ #category : #'*Debug-Utils' }
Object >> haltFromCount: anInteger [
"Always halt after a count has been reached"

<debuggerCompleteToSender>
Halt fromCount: anInteger
]

{ #category : #'*Debug-Utils' }
Object >> haltIf: condition [
<debuggerCompleteToSender>
Halt if: condition.
]

{ #category : #'*Debug-Utils' }
Object >> haltIfNil [
]

{ #category : #'*Debug-Utils' }
Object >> haltIfNotTest [
"Halt if execution was not started by a test. This is useful as this means one can just run tests undisturbed, while a execution for example from the Playground would be halted"
<debuggerCompleteToSender>
Halt ifNotTest
]

{ #category : #'*Debug-Utils' }
Object >> haltIfTest [
"Halt if execution was started by a test. These #halts are just active in the tests, useful when you want to add a halt in methods that are executed a lot (e.g. collections)"
<debuggerCompleteToSender>
Halt ifTest
]

{ #category : #'*Debug-Utils' }
Object >> haltOnCount: anInteger [
"Halts once when a count is reached"

<debuggerCompleteToSender>
Halt onCount: anInteger
]

{ #category : #'*Debug-Utils' }
Object >> haltOnce [
<debuggerCompleteToSender>
Halt once.
]
7 changes: 7 additions & 0 deletions src/Debug-Utils/UndefinedObject.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #UndefinedObject }

{ #category : #'*Debug-Utils' }
UndefinedObject >> haltIfNil [
<debuggerCompleteToSender>
Halt now
]
1 change: 1 addition & 0 deletions src/Debug-Utils/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Debug-Utils' }
2 changes: 1 addition & 1 deletion src/Kernel/ManifestKernel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ManifestKernel class >> ignoredDependencies [

{ #category : #'meta-data - dependency analyser' }
ManifestKernel class >> manuallyResolvedDependencies [
^ #(#'System-Settings-Core' #'System-Sources' #'System-Platforms' #'Transcript-Core' #'Multilingual-TextConversion' #'AST-Core' #'Shift-ClassBuilder' #'Regex-Core' #'System-Localization' #'RPackage-Core' #'Zinc-Character-Encoding-Core' #Reflectivity #'Shift-ClassInstaller' #'FFI-Kernel')
^ #(#'System-Settings-Core' #'System-Sources' #'System-Platforms' #'Transcript-Core' #'Multilingual-TextConversion' #'AST-Core' #'Shift-ClassBuilder' #'Regex-Core' #'RPackage-Core' #'Zinc-Character-Encoding-Core' #Reflectivity #'Shift-ClassInstaller' #'FFI-Kernel')
]

{ #category : #'meta-data' }
Expand Down
59 changes: 0 additions & 59 deletions src/Kernel/Object.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -961,65 +961,6 @@ Object >> fullPrintString [
^ String streamContents: [:s | self printOn: s]
]

{ #category : #halting }
Object >> halt [
"This is the typical message to use for inserting breakpoints during debugging."
<debuggerCompleteToSender>
Halt now
]

{ #category : #halting }
Object >> halt: aString [
<debuggerCompleteToSender>
Halt now: aString
]

{ #category : #halting }
Object >> haltFromCount: anInteger [
"Always halt after a count has been reached"

<debuggerCompleteToSender>
Halt fromCount: anInteger
]

{ #category : #halting }
Object >> haltIf: condition [
<debuggerCompleteToSender>
Halt if: condition.
]

{ #category : #testing }
Object >> haltIfNil [
]

{ #category : #halting }
Object >> haltIfNotTest [
"Halt if execution was not started by a test. This is useful as this means one can just run tests undisturbed, while a execution for example from the Playground would be halted"
<debuggerCompleteToSender>
Halt ifNotTest
]

{ #category : #halting }
Object >> haltIfTest [
"Halt if execution was started by a test. These #halts are just active in the tests, useful when you want to add a halt in methods that are executed a lot (e.g. collections)"
<debuggerCompleteToSender>
Halt ifTest
]

{ #category : #halting }
Object >> haltOnCount: anInteger [
"Halts once when a count is reached"

<debuggerCompleteToSender>
Halt onCount: anInteger
]

{ #category : #halting }
Object >> haltOnce [
<debuggerCompleteToSender>
Halt once.
]

{ #category : #'process termination handling' }
Object >> handleProcessTerminationOfWaitingContext: suspendedContext [
^suspendedContext
Expand Down
6 changes: 0 additions & 6 deletions src/Kernel/UndefinedObject.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,6 @@ UndefinedObject >> findUndeclaredVariableIn: ast [
^nil
]

{ #category : #testing }
UndefinedObject >> haltIfNil [
<debuggerCompleteToSender>
Halt now
]

{ #category : #'bottom context' }
UndefinedObject >> handleSignal: exception [
"When no more handler (on:do:) context left in sender chain this gets called. Return from signal with default action."
Expand Down

0 comments on commit e1ff41f

Please sign in to comment.