[m-dev.] for review: declarative debugger back end

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Dec 13 00:53:19 AEDT 1998


On 13-Dec-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 10-Dec-1998, Mark Anthony BROWN <dougl at cs.mu.OZ.AU> wrote:
> > 	if (MR_DETISM_DET_STACK(entry->MR_sle_detism)) {
> > 		MR_stackvar(decl_slot) = (Word) edt_node;
> > 		MR_stackvar(decl_slot + 1) = (Word) MR_edt_parent;
> > 	} else {
> > 		MR_framevar(decl_slot) = (Word) edt_node;
> > 		MR_framevar(decl_slot + 1) = (Word) MR_edt_parent;
> > 	}
> 
> You need to call restore_transient_registers() before using
> MR_stackvar() or MR_framevar() inside a C function.

... since those macros implicitly reference the MR_sp and MR_curfr
registers, which may be transient (i.e. clobbered by C function
entry or exit).

On the other hand, in this case I think perhaps you should be
using `MR_based_stackvar(MR_saved_sp(saved_regs), decl_slot)'
rather than `MR_stackvar(decl_slot)'.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh at 128.250.37.3        |     -- leaked Microsoft memo.



More information about the developers mailing list