How do I debug an arbitrary Process? Help!

Lex Spoon lex at cc.gatech.edu
Wed Feb 13 17:52:34 UTC 2002


Ned Konz <ned at bike-nomad.com> wrote:
> On Monday 11 February 2002 10:11 pm, I wrote:
> 
> > Can anyone help me get the Debugger to work with arbitrary suspended
> > processes (i.e. non-UI ones that weren't interrupted with Cmd-. or hit
> > halts or other exceptions)?
> 
> So far I have this. I'm sure it has problems; notably, the 200 msec delay is 
> a hack for debugging the UI process. I don't know why it was needed, but I 
> can't debug the UI process from the Process Browser without it (I don't need 
> it if I call debugWithTitle: from a DoIt in a Workspace).

Hmm, maybe it has to do with the process gets suspended while Morphic is
in different parts of an interaction cycle, and with your hack it tends
to get suspended between cycles?  If this is the case, a "yield" would
probably be just as effective as a 200 millisecond delay.  Neither is
guaranteed to work, either, if this is the problem,

Better yet, isn't there a way now to ask code to run in the UI thread? 
That mechanism addresses the same general problem, and could probably be
used here.  Then again maybe I'm imagining things; I don't see anything
in WorldState.


Overall, I don't think there is a great solution.  Interrupting
processes at arbitrary times causes trouble.  It seems like every thread
library has "suspend" and "kill" in it to start with, followed a year or
two later by these operations being deprecated.  But, watchya gonna do?


-Lex



More information about the Squeak-dev mailing list