Re: [eclipse-clp-users] Question about recursion frames in ECLiPSe-CLP

From: Kish Shen <kisshen_at_...5...>
Date: Tue, 13 Jan 2009 14:15:59 +0000
Schüpbach Adrian Laurent wrote:
> Dear ECLiPSe-team
> 
> I'm trying to port ECLiPSe-CLP to a new OS we are currently writing and I'd
> have some questions.
> 
> I started with the minimal set of files needed to build Kernel/<arch>/sepia
> and wanted to get that working first. That means I take the files
> in Kernel/ and Shm/ and I build libeclipse, libshm and libdummies and
> finally link it together with a simple example (eg_c_basic).
> 
> I'm using version 6.0.42.
> 
> I can compile and link the example file which does
> ec_init(), ec_post_string(), ec_resume(), ec_queue_read() and
> ec_cleanup().
> 
> When I try to run it, ec_init() almost terminates, but not completely.
> It reads in lib/kernel.eco and parses it, that seems ok.
> 
> At some point, just before ec_init() terminates, ec_emulate() returns with
> PTHROW due to a recursion frame. PTHROW is returned by
> emu.c at around line 6600 where it checks for the recursion frame.
> 
> 
> I have some questions about that:
> 
> 1. What is a recursion frame and why does it usually get pushed?
> 2. Why would the recursion frame not be expected at this point?
> 3. Which emulator is exited here? Are there several emulators?
> 4. Is there anything I can look for to identify the problem?
> 5. Is there any detailed code documentation?
> 
> 
> This is the piece of code in emu.c at about line 6600 which causes the emulator
> to return PTHROW. IsRecursionFrame(BTop(pw1)) is true while
> IsInterruptFrame(BTop(pw1)) is false.
> 
> 
>         else if (IsInterruptFrame(BTop(pw1))||IsRecursionFrame(BTop(pw1)))
> 		{
> 		// exit an emulator: restore everything from the invoc frame.
>         // Normally we will continue throwing in an earlier emulator
>         // invocation, but that's not sure because the C code can
>         // choose not to propagate the throw. Therefore we must
>         // restore the engine to a reasonable state now rather
>         // than wait for the catch!
>         //
>             err_code = PTHROW;
> 		    B.args = pw1;
> 		    goto _exit_emulator_;	/// (err_code,scratch_pw)
> 		}
>         else	/* other frame, skip it */
> 
> 
> Unfortunately I don't fully understand the code and the execution flow there.
> I hope you can give me some hints what I should look for or how I could
> try to debug.
> 
> Thank you in advance!
> 
> Cheers
> Adrian
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users

Hi Adrian,

You mentioned in your previous e-mails to me about this that you cross 
compiled ECLiPSe for this OS. For cross-compile to work correctly, you
should have also ran configure for the platform you are cross-compiling 
to. Otherwise, it is possible that some of the platform dependent 
settings may lead to runtime errors with ECLiPSe -- this could be a 
reason you are getting your error.

As to your detailed question about the PTHORW, I am probably not the 
best person to answer questions on it. However, my guess is that there 
was some (unexpected) error in executing the initialisation ECLiPSe code 
when ec_init() is executed, and this is resulting in an error that the 
system is unable to handle.

Cheers,

Kish


-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
Received on Tue Jan 13 2009 - 14:45:56 CET

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST