nice.  i'll give it a try later.

thinking outloud here; it seems that one could extend the capability
of ?c for generating acid code to include creating call wrapper
for any function that is marked for unit testing (perhaps another
#pragma?)

> This one sounds like to work (except it does not save registers) ...
> 
> defn call(addr)
> {
>       local pco;
> 
>       // we need stack space, and thus process stopped.
>       if status(pid) != "Stopped" then {
>               print("Waiting...\n");
>               stop(pid);
>       }
> 
>       // Backup orginal instruction
>       pco = fmt(*PC, bpfmt);
> 
>       // Put a temporary breakpoint
>       **PC = bpinst;
>       
>       // update stack pointer
>       *SP = *SP - 4;
> 
>       // make called function returning to this point
>       **SP = *PC;
> 
>       // set PC to function to call
>       *PC = addr;
> 
>       // do the call
>       startstop(pid);
> 
>       // restore original instruction
>       *PC = pco;
> }
> 
> Phil;


Reply via email to