logo       

Re: WinCE Exception handling support in gcc: msg#00074

gnu.cegcc.devel

Subject: Re: WinCE Exception handling support in gcc

Danny Backx wrote:
> Guys,
>
> I've been digging in gcc internals and succeeded in implementing stuff
> that allows us to write code such as
> int main(int argc, char *argv[])
> __attribute__((__exception_handler__(handler)));
> to indicate that handler is the exception handler for function main.
>
> The patch is attached, it only affects four files in gcc.
>
> What this gcc patch does is to generate an additional couple of lines of
> assembler code for those functions that have an exception handler.
>
> Attached is an example in C and the assembler code generated for it. In
> the arm-wince-mingw32ce world, only patches to gcc are required, no
> changes to any runtime are needed. (I need to look into the cegcc
> environment, things are slightly different there because a default
> exception handler is in place there.)
>

I think you should push this down to wince-pe.h to have it shared by
mingw32ce and cegcc. We can then convert cegcc.dll to use the
attribute too if we want. If we don't want to, then, we just don't
use it.

> Comments are welcome as always.
>
> Pedro, is it ok to commit this to SVN ?
>

Can we do a little bit of reorganizing/cleanup first please?

* Please (and sorry for being picky about it), please follow
the GNU coding standards - whitespace/tabbing, spaces before (,
comments, etc. Better do it early, while the patch is
easily 'diffable'.

* Could you rename the pe.h macros you are overriding to something
like the pseudo-patch:

++ pe.h
-#define ASM_DECLARE_FUNCTION_NAME
+#define ARM_PE_DECLARE_FUNCTION_NAME
+#define ASM_DECLARE_FUNCTION_NAME ARM_PE_DECLARE_FUNCTION_NAME

, and then in wince-pe.h, reuse ARM_PE_DECLARE_FUNCTION_NAME,
similarly to how ARM_DECLARE_FUNCTION_NAME is reused? I'd like
to avoid code duplication.

* I'm sure this is incomplete, and there are a few things that
need to be done - like limiting some optimizations/re-orderings in
functions with handlers - but you can leave this for phase
two for now.

* could you contemplate using local symbols with local label
prefix (.L) instead of _cegcc_ prefix on the size/end
symbols? There shouldn't be a need to export all those
auxilary symbols, is there?

* I don't see the prolog size in the .pdata structure? Did I miss
something?

Cheers,
Pedro Alves




-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise