Skip to content

Commit

Permalink
work in progress - debugger hung again on simple change to source
Browse files Browse the repository at this point in the history
#927

Did find, what I think, is a better way to wait for a debugger answer. Using ModalMsgLoop which blocks the main thread without blocking the messaging queue so the gui won't freeze.
  • Loading branch information
Eric Winger authored and Eric Winger committed Oct 14, 2022
1 parent 73b03f1 commit 82bf4d9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion sources/JadeDebugger.cls
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ reportError: gsError
(debugger := self debuggerFor: gsError processOop) notNil
ifTrue:
[debugger getProcessList; update.
Processor activeProcess terminate.
Processor activeProcess kill.
self error: 'We should never get here!!'].
(#(2709 6005) includes: gsError errorReport number)
ifTrue: [^self openDebuggerOnException: gsError].
Expand Down
20 changes: 7 additions & 13 deletions sources/JadePresenter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -340,19 +340,13 @@ transactionModeValueHolder
waitForAnswer: thingThatCanAnswer
| theAnswer deferredValue |
deferredValue := [thingThatCanAnswer answer] deferredValue.
[deferredValue hasValue] whileFalse:
[| loop |
loop :=
[SessionManager inputState
loopWhile: [deferredValue hasValue not and: [thingThatCanAnswer isDeafObject not]]]
fork.
(Delay forMilliseconds: 1) wait.
[loop isAlive] whileTrue:
[thingThatCanAnswer isDeafObject
ifTrue:
[loop terminate.
^deferredValue hasValue ifTrue: [deferredValue value] ifFalse: [nil]].
(Delay forMilliseconds: 1) wait]].
[deferredValue hasValue not and: [thingThatCanAnswer isDeafObject not]] whileTrue:
[| sync |
sync := ModalMsgLoop new.

[(Delay forMilliseconds: 1) wait.
sync signal] fork.
sync wait].
theAnswer := [deferredValue value] on: Error
do:
[:ex |
Expand Down
2 changes: 1 addition & 1 deletion sources/JadeiteDebugger.cls
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ methodValueChanged
self displayUncompilableSourceIn: codePane documentPresenter!

onCloseRequested: boolValueHolder
self isOkayToChangeFrame ifFalse: [^self].
self isOkayToChangeFrame ifFalse: [^boolValueHolder value: false].
super onCloseRequested: boolValueHolder!

onIdleEntered
Expand Down
6 changes: 2 additions & 4 deletions sources/JadeiteDebuggerDataCuratorTestCase.cls
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ closeDebuggers
JadeiteMethodListBrowser allInstances
do: [:browser | self assert: (browser view isKindOf: DeafObject)].
JadeiteBrowser allInstances do: [:browser | self assert: (browser view isKindOf: DeafObject)].
JadeiteDebugger allInstances do:
[:theDebugger |
(theDebugger view isKindOf: DeafObject) ifFalse: [(Delay forMilliseconds: 50) wait].
self assert: (theDebugger view isKindOf: DeafObject)].
JadeiteDebugger allInstances
do: [:theDebugger | (theDebugger view isKindOf: DeafObject) ifFalse: [(Delay forMilliseconds: 50) wait]].
MemoryManager current collectGarbage.
(Delay forMilliseconds: 50) wait.
self purgeInstances: JadeiteBrowser.
Expand Down
1 change: 1 addition & 0 deletions sources/JadeiteDebuggerTestCase.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,7 @@ test_loginButtonEnablementAfterDebug

[GciSession current ifNotNil: [:sess | sess logout].
query := self closeJadeiteLoginShells.
JadeiteLoginShell allInstances do:[:loginShell | self destroy: loginShell].
shell := JadeiteLoginShell show position: 80 @ 20.
"make sure we're logging in as right user"
shell userIDPresenter value: user.
Expand Down

0 comments on commit 82bf4d9

Please sign in to comment.