1. A need for Euphoria code.
- Posted by Bernie Ryan <xotron at bluefrognet.net> May 31, 2003
- 512 views
All you coding genious out there, I have a challange for you. Can someone think of a way to emulate the "C" functions setjmp() longjmp() jmp_buf in Euphoria. Bernie
2. Re: A need for Euphoria code.
- Posted by jbrown105 at speedymail.org May 31, 2003
- 470 views
On Sat, May 31, 2003 at 10:31:00AM -0400, Bernie Ryan wrote: > > > All you coding genious out there, I have a challange > for you. > Can someone think of a way to emulate the "C" functions > setjmp() longjmp() jmp_buf in Euphoria. > > Bernie > There is no way to save the current context in pure Eu code. It is flat out impossble. Period. If you are willing to use asm, you can try to save eax, ebx, ecx, edx, eip, esp, ebp, .... etc. into a section of memory, but I'm not sure how you'd reset the variables in memory. Without access to the internals of the interpreter, I doubt that it could be done at all. jbrown -- /"\ ASCII ribbon | http://www.geocities.com/jbrown1050/ \ / campain against | Linux User:190064 X HTML in e-mail and | Linux Machine:84163 /*\ news, and unneeded MIME |
3. Re: A need for Euphoria code.
- Posted by gertie at visionsix.com May 31, 2003
- 460 views
On 31 May 2003, at 13:44, jbrown105 at speedymail.org wrote: > > > On Sat, May 31, 2003 at 10:31:00AM -0400, Bernie Ryan wrote: > > > > > > All you coding genious out there, I have a challange > > for you. > > Can someone think of a way to emulate the "C" functions > > setjmp() longjmp() jmp_buf in Euphoria. > > > > Bernie > > > > There is no way to save the current context in pure Eu code. It is flat > out impossble. Period. > > If you are willing to use asm, you can try to save eax, ebx, ecx, edx, eip, > esp, > ebp, .... etc. into a section of memory, but I'm not sure how you'd reset the > variables in memory. > > Without access to the internals of the interpreter, I doubt that it could be > done at all. But it's trivial in mirc. Kat
4. Re: A need for Euphoria code.
- Posted by jbrown105 at speedymail.org May 31, 2003
- 471 views
On Sat, May 31, 2003 at 01:28:17PM -0500, gertie at visionsix.com wrote: > > > On 31 May 2003, at 13:44, jbrown105 at speedymail.org wrote: > > > > > On Sat, May 31, 2003 at 10:31:00AM -0400, Bernie Ryan wrote: > > > > > > > > > All you coding genious out there, I have a challange > > > for you. > > > Can someone think of a way to emulate the "C" functions > > > setjmp() longjmp() jmp_buf in Euphoria. > > > > > > Bernie > > > > > > > There is no way to save the current context in pure Eu code. It is flat > > out impossble. Period. > > > > If you are willing to use asm, you can try to save eax, ebx, ecx, edx, eip, > > esp, > > ebp, .... etc. into a section of memory, but I'm not sure how you'd reset > > the > > variables in memory. > > > > Without access to the internals of the interpreter, I doubt that it could be > > done at all. > > But it's trivial in mirc. > > Kat > If you wanna edit the Eu interpreter source, so you can do a dump of all the variables, and also save the current position of the routine stack, from within the Eu code, and later reload them, then it would also be trivial to do this in Eu. But, since the RDS version of Eu does NOT support doing this, it is not so trivial. I would say that using define_c_func() on longjmp would be a good idea, except the man pages says that if the function calling setjmp returns then the pointer it sets is invalidated. jbrown -- /"\ ASCII ribbon | http://www.geocities.com/jbrown1050/ \ / campain against | Linux User:190064 X HTML in e-mail and | Linux Machine:84163 /*\ news, and unneeded MIME |
5. Re: A need for Euphoria code.
- Posted by gertie at visionsix.com May 31, 2003
- 519 views
On 31 May 2003, at 14:51, jbrown105 at speedymail.org wrote: > > > On Sat, May 31, 2003 at 01:28:17PM -0500, gertie at visionsix.com wrote: > > > > > > On 31 May 2003, at 13:44, jbrown105 at speedymail.org wrote: > > > > > > > > On Sat, May 31, 2003 at 10:31:00AM -0400, Bernie Ryan wrote: > > > > > > > > > > > > All you coding genious out there, I have a challange > > > > for you. > > > > Can someone think of a way to emulate the "C" functions > > > > setjmp() longjmp() jmp_buf in Euphoria. > > > > > > > > Bernie > > > > > > > > > > There is no way to save the current context in pure Eu code. It is flat > > > out > > > impossble. Period. > > > > > > If you are willing to use asm, you can try to save eax, ebx, ecx, edx, > > > eip, > > > esp, ebp, .... etc. into a section of memory, but I'm not sure how you'd > > > reset the variables in memory. > > > > > > Without access to the internals of the interpreter, I doubt that it could > > > be > > > done at all. > > > > But it's trivial in mirc. > > > > Kat > > > > If you wanna edit the Eu interpreter source, so you can do a dump of > all the variables, and also save the current position of the routine stack, I think Karl already did that part. > from > within the Eu code, and later reload them, then it would also be trivial to do > this in Eu. > > But, since the RDS version of Eu does NOT support doing this, it is not so > trivial. Yeas, we lose debugging tools when using the non-RDS interpreters. Maybe with Openeu this will be possible? Kat
6. Re: A need for Euphoria code.
- Posted by jbrown105 at speedymail.org May 31, 2003
- 487 views
On Sat, May 31, 2003 at 02:03:38PM -0500, gertie at visionsix.com wrote: <snip> > > But, since the RDS version of Eu does NOT support doing this, it is not so > > trivial. > > Yeas, we lose debugging tools when using the non-RDS interpreters. Maybe > with Openeu this will be possible? > > Kat > I can't say for sure, but if it supports exceptions and goto, I don't see why setjmp and longjmp wouldn't be allowed. jbrown -- /"\ ASCII ribbon | http://www.geocities.com/jbrown1050/ \ / campain against | Linux User:190064 X HTML in e-mail and | Linux Machine:84163 /*\ news, and unneeded MIME |
7. Re: A need for Euphoria code.
- Posted by kbochert at copper.net May 31, 2003
- 459 views
On 31 May 2003 at 14:03, gertie at visionsix.com wrote: > > > On 31 May 2003, at 14:51, jbrown105 at speedymail.org wrote: > > > If you wanna edit the Eu interpreter source, so you can do a dump of > > all the variables, and also save the current position of the routine stack, > > I think Karl already did that part. > Bach has throw -- catch exceptions, which I think are a cleaner solution than longjmp - setjmp > > Yeas, we lose debugging tools when using the non-RDS interpreters. At Rob Craigs insistance. Bach 2.0 will at least have logging and regression testing built into the '?' operator. Karl Bochert