Skip to content

Commit

Permalink
Make stack printing more robust in absence of semaphore and mutex cla…
Browse files Browse the repository at this point in the history
…sses
  • Loading branch information
guillep committed Aug 7, 2023
1 parent 8996cf9 commit 842320f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions smalltalksrc/VMMaker/StackInterpreter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11435,15 +11435,18 @@ StackInterpreter >> printAllStacks [
self
cr;
print: 'suspended processes'.

"Semaphore or mutex classes could not be installed"
semaphoreClass := objectMemory classSemaphore.
mutexClass := objectMemory classMutex.
semaphoreClass := objectMemory compactIndexOfClass: semaphoreClass.
mutexClass := objectMemory compactIndexOfClass: mutexClass.
semaphoreClass := semaphoreClass = objectMemory nilObject ifFalse: [ objectMemory compactIndexOfClass: semaphoreClass ].
mutexClass := mutexClass = objectMemory nilObject ifFalse: [ objectMemory compactIndexOfClass: mutexClass ].
objectMemory allHeapEntitiesDo: [ :obj |
| classIdx |
classIdx := objectMemory classIndexOf: obj.
(classIdx = semaphoreClass or: [ classIdx = mutexClass ]) ifTrue: [
self printProcsOnList: obj ] ]
((semaphoreClass notNil and: [ classIdx = semaphoreClass ])
or: [ mutexClass notNil and: [ classIdx = mutexClass ] ])
ifTrue: [ self printProcsOnList: obj ] ]
]

{ #category : #'debug printing' }
Expand Down

0 comments on commit 842320f

Please sign in to comment.