Drop To Selected Context

Eric Arseneau eat at huv.com
Sun Jun 25 01:01:19 UTC 2000


There is a feature of the VA debugger which is incredibly useful, which I've
added to the Squeak debugger.  This feature allows a developer to select a
context, and drop to it.  Dropping to it means to unwind/get rid of all the
contexts above, reset pc to the beginning of the context, and stay in the
debugger.  This allows the developer to re-run the same method using step
and send and all those things.

Here is the method that does the drop in the Debugger

Debugger>>#dropToSelectedFrame
	"
	Trim the stack back to the currently selected frame and reset PC to the
beginning of the method."

	| context |
	(self selectedContext isKindOf: MethodContext) ifFalse: [
		self error: 'Only handles method contexts for now.'].
	context := self selectedContext.
	interruptedProcess popTo: context.
	context restart.
	self resetContext: context

The problem is handling block contexts.  I tried a few experiments and I
couldn't get it to quite work right.  Being lazy, I thought I'd ask the list
and see if anybody would know how to 'restart' a block context.  A method
context already has the ability to be 'restart'ed, but block contexts do
not.  Any suggestions on how to implement restart on a block context ?





More information about the Squeak-dev mailing list