[m-dev.] Please help... once more

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Oct 13 23:10:25 AEDT 2000


On 13-Oct-2000, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> | On 22-Sep-2000, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> | > Ok, I think I have finally find the rigth magic incantations; to make it 
> | > work, I need to wrap the call to MR_COLLECT_filter() with:
> | > 
> | >         [set event_info.MR_max_mr_num to the rigth value]
> | > 	MR_copy_regs_to_saved_regs(event_info.MR_max_mr_num, saved_regs);
> | >         MR_COLLECT_filter();
> | > 	MR_copy_regs_to_saved_regs(event_info.MR_max_mr_num, saved_regs);
> | 
> | Why are those calls needed?
> 
> Well, I'm not really sure. I have just guessed from the code:
> 
> (1) MR_trace_real() calls MR_trace_event() which calls MR_trace_event_external()
> which was calling MR_COLLECT_filter().
> 
> (2) I moved the call to  MR_COLLECT_filter() from MR_trace_event_external() to 
>  MR_trace_real().
> 
> (3) MR_copy_regs_to_saved_regs() and MR_copy_saved_regs_to_regs() were wrapping
> the call to MR_trace_event_external(), so I make them wrap the call to
> MR_COLLECT_filter() and it solved the segv problem...

Oh, OK, I understand.  The reason I was confused was that I missed step (2).
Those calls are needed there for the same reason that they're needed
in MR_trace_event().  The reason is so that the use of the Mercury
registers by the called Mercury code doesn't stuff things up for the
code being debugged, as explained in trace/README.

But the factor of 5 seems a bit large.  Is that on x86 or on sparc?

If you want us to optimize it, then it would help if you could post
the exact diff between the two versions that leads to a 5x slowdown.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list