On Sun, Jun 03, 2007 at 11:09:34PM +0100, Pedro Alves wrote:
> Kevin O'Connor wrote:
> > So, is it possible to have mingw32ce install a global SEH handler that
> > just translates the exception into an sjlj one?  That is, can we
> > modify the standard crt0.S file so that it causes wince exceptions to
> > raise C++ exceptions that g++ can then handle?
> > 
> 
> Maybe, but it would be tricky.
>[...]
> The cegcc's crt0.S, start.c and __eh_handler.S files implement
> something similar which may help as a starting point.

Hrmm.  I have another problem - it looks like gcc will optimize away
try/catch blocks if it doesn't think the code can throw an exception.
If we went down this route, would it be possible to prevent gcc from
doing that?

> > However, I'm a bit concerned with using IsBad{Read,Write}Ptr.
> You're right, the WinCE version of the docs isn't clear.  I've seen
> several discussions on IsBad*Ptr, and always understood it as using
> a __try/__except block inside.

I'm not sure how it would do that.  What would IsBadWritePtr(x, 400)
actually write to memory?  If it did actually generate extra
read/write memory accesses that would be really bad - in haret we use
these routines to get at memory mapped registers, and extra accesses
could confuse the chips.

Also, haret is used on wince 2.11 - 6.0.  You can imagine all the
weird ways wince versions differ.  :-)

> <need a hammer?>
> You can also try creating a child process to take care of
> the dangerous writing.  If the app crashes, you know you had a bad pointer :)
> You could feed the data to the child process through some kind of IPC.
> Eh, pipes would be nice. :)
> </need a hammer?>

Heh.  :-)

-Kevin

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to