[virtmach] break / watch points

David Rush kumo@bellsouth.net
18 Apr 2000 23:39:49 +0100

thaddaeus.frogley@creaturelabs.com writes:
> Who's responsibility, the VM or the debugger?

Yes. I've never had enough time in my schedules to build a debugger,
so I've always opted for the '80s microprocessor approach and had a
break opcode in my instruction set, which would either invoke a VM
inspector (resident in the VM code) or actually kick the host system
debugger into gear. Given a little bit of support in the source
language it works pretty good.

And you don't *also* have to worry as much about debugging the
debugger. This is a *big* win.

> That is, should: 
> a) the VM keep a list of break condition objects and pass control to the
> debugger when one evaluates to "true", or
> b) the VM poll the debugger after every instruction, and let it do the
> checking.

If I had real time and budget, I'd implement at least a breakpoint
instruction and a trace bit. Given those two you can build just about
everything else at the debugger level. Going further, VM support for
watchpoints is way more efficient than debugger-based implementations.

david rush
>From the start...the flute has been associated with pure (some might
say impure) energy. Its sound releases something naturally untamed, as
if a squirrel were let loose in a church." --Seamus Heaney