From a4e8527dee99d435c25f013fc4e270db68c69e6a Mon Sep 17 00:00:00 2001 From: Evan Donahue Date: Wed, 7 Sep 2022 20:44:13 +0900 Subject: [PATCH] - Made Halt print without context when signalled directly, to match existing behavior --- .../StDebuggerContextPredicateTest.class.st | 8 ++++++++ src/NewTools-Debugger/Halt.extension.st | 8 ++++++++ src/NewTools-Debugger/StDebuggerActionModel.class.st | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/NewTools-Debugger/Halt.extension.st diff --git a/src/NewTools-Debugger-Tests/StDebuggerContextPredicateTest.class.st b/src/NewTools-Debugger-Tests/StDebuggerContextPredicateTest.class.st index f8d2f1669..69ac5f1de 100644 --- a/src/NewTools-Debugger-Tests/StDebuggerContextPredicateTest.class.st +++ b/src/NewTools-Debugger-Tests/StDebuggerContextPredicateTest.class.st @@ -80,6 +80,14 @@ StDebuggerContextPredicateTest >> testPrintHaltIfDescription [ equals: 'Halt in [ Halt if: [ true ] ] in StDebuggerContextPredicateTest>>testPrintHaltIfDescription'. ] +{ #category : #tests } +StDebuggerContextPredicateTest >> testPrintHaltNowDescription [ + self assert: (StDebuggerActionModel on: + ([ Halt now ] on: Exception do: + [ :e | StTestDebuggerProvider new sessionFor: nil exception: e ]) session) statusStringForContext + equals: 'Halt'. +] + { #category : #tests } StDebuggerContextPredicateTest >> testPrintPostMortemDescription [ self skip. diff --git a/src/NewTools-Debugger/Halt.extension.st b/src/NewTools-Debugger/Halt.extension.st new file mode 100644 index 000000000..bdfbc82c3 --- /dev/null +++ b/src/NewTools-Debugger/Halt.extension.st @@ -0,0 +1,8 @@ +Extension { #name : #Halt } + +{ #category : #'*NewTools-Debugger' } +Halt >> description [ + (self signalContext receiver isKindOf: Exception) + & (self signalContext selector = #signal) ifTrue: [ ^ 'Halt' ]. + ^ 'Halt in ', self signalContext asString. +] diff --git a/src/NewTools-Debugger/StDebuggerActionModel.class.st b/src/NewTools-Debugger/StDebuggerActionModel.class.st index e5d517591..9145cdf7f 100644 --- a/src/NewTools-Debugger/StDebuggerActionModel.class.st +++ b/src/NewTools-Debugger/StDebuggerActionModel.class.st @@ -351,7 +351,7 @@ StDebuggerActionModel >> stackOfSize: anInteger [ { #category : #context } StDebuggerActionModel >> statusStringForContext [ - ^ self contextPredicate printDescription + ^ self exception description ] { #category : #'debug - stepping' }