[Pharo-dev] Questions about DebugSession>>isContextPostMortem:
tdupriez at ens-paris-saclay.fr
Thu Mar 21 06:06:25 EDT 2019
While looking at the DebugSession>>isContextPostMortem: method (code
below), I got three questions:
1) There is a check for whether the suspendedContext (top context) of
the process is nil. Does it even make sense for a process not to have
any top context?
2) It seems that all the last 3 lines are doing is to check whether
selectedContext is in the context chain of the process. Could they be
rewritten into this simpler one-liner? `|^ (suspendedContext
hasContext: selectedContext) not`|
3) Overall, this method says that a context C is "post mortem" if the
process controlled by the DebugSession has a top context and C is not in
its context chain. That's the practical definition. Could someone shed
some light on the high-level definition of "post mortem"? Because "post
mortem" is like "after death", but the death of what? A context that
merely belongs to another context chain would be considered "post
mortem" by the practical definition, but there's no death in this case...
|DebugSession>>isContextPostMortem: selectedContext "return whether
we're inspecting a frozen exception without a process attached" |
suspendedContext | suspendedContext := interruptedProcess
suspendedContext. suspendedContext ifNil: [ ^ false ]. (suspendedContext
== selectedContext) ifTrue: [ ^ false ]. ^ (suspendedContext
findContextSuchThat: [:c | c sender == selectedContext]) isNil ``` |
Does someone know the answer to some (or all) of these questions?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev