How do I debug an arbitrary Process? Help!

Ned Konz ned at bike-nomad.com
Tue Feb 12 18:47:22 UTC 2002


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).

Process>>debugWithTitle: title 
	"Open a debugger on me"
	"Is this the UI process?"
	self == Processor activeProcess
		ifTrue: [[Project interruptName: title] fork.
			(Delay forMilliseconds: 200) wait.
			^ self].
	myList isNil
		ifTrue: [^ self]
		ifFalse: [myList
				remove: self
				ifAbsent: [].
			self offList].
	self suspend.
	Debugger openInterrupt: title onProcess: self


Can anyone provide some guidance on this?

Thanks,
-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com



More information about the Squeak-dev mailing list