Re: Calling Func/Proc
- Posted by Matt Lewis <matthewwalkerlewis at gmail?com> Jul 13, 2007
- 670 views
c.k.lester wrote: > > I didn't understand Rob's post regarding it's non-doability in regard to the > Translator, but I've got a moment now to read for comprehension. :) The issue is that, in the interpreter, you have a compiled C program that maintains the state of your euphoria application, including its own call stack, which would be fairly trivial to see where you came from (obviously, since you get this in ex.err). However, once you translate, you now have a compiled C program, and the interpreter no longer maintains all that information. The stack is the native stack, and while you could, in theory, walk the stack (like a debugger would do), you'd lose a lot of information (well, in theory, you could read debugging symbols like a debugger would). I guess there's a case to be made that this is a debugging tool (like trace), and that some differences to the interpreter and translator are acceptable. We could, in theory, maintain a custom call stack in the translator by automatically calling some library routine to maintain this stuff for us, at least within "with trace" code. It's not a trivial thing to do, but might be possible, and be faithful to the interpreter/translator compatibility goal. Matt