Re: WxEuphoria on ARM
- Posted by jimcbrown (admin) Jan 11, 2012
- 1989 views
object WXEUAPI mouse_event_position(wxMouseEvent *event) { s1_ptr pos = NewS1(2); event->getPosition( pos->base + 1, pos->base + 2 ); return MAKE_SEQ( pos ); }
Unfortunately I'm still getting segmentation faults. I'm sure there is a key point I'm overlooking; I'll try to hunt it down!
Actually, looking at this message http://openeuphoria.org/forum/m/116226.wc
I seem to recall very similar errors happening. I believe that ARM processors require 16 byte alignment or something. We've probably either missed doing so somewhere or had a regression.
Yes, I use to get this illegal instruction when we first started:
0x002ff9b4 in decompress (c=251) at be_decompress.c:75 75 d = (double)*(float *)string_ptr;
Which was fixed with:
float f; d = (double)*(float*)memcpy((void*)&f, (void*)string_ptr, 4);
Jacques, for your illegal instruction, can you give this a try?
... //--d= *(double *)string_ptr; memcpy(&d, (double *)string_ptr, 8); ...
Thanks,
Ira
I wonder if this would fix it:
object WXEUAPI mouse_event_position(wxMouseEvent *event) { wxCoord fx, fy; event->getPosition( &fx, &fy ); s1_ptr pos = NewS1(2); memcpy(pos->base + 1, &fx, sizeof(wxCoord)); memcpy(pos->base + 2, &fy, sizeof(wxCoord)); return MAKE_SEQ( pos ); }
That is, using memcpy() to get around the alignment issues which cause the illegal instructions/segmentation fault errors.
Or try memmove() :
object WXEUAPI mouse_event_position(wxMouseEvent *event) { wxCoord fx, fy; event->getPosition( &fx, &fy ); s1_ptr pos = NewS1(2); memmove(pos->base + 1, &fx, sizeof(wxCoord)); memmove(pos->base + 2, &fy, sizeof(wxCoord)); return MAKE_SEQ( pos ); }
Is there any interest in using Euphoria on ARM platforms, especially with the Raspberrypi (http://www.raspberrypi.org/ , http://openeuphoria.org/forum/116139.wc#116139) coming out soon?
Thanks,
Ira
Yes, definitely. I have it running also, although I haven't set up wxWidgets or wxEuphoria.