controlling exception type per target
Robert Lipe
robertl@dgii.com
Thu Sep 25 10:31:00 GMT 1997
I've been looking at the dwarf2 exception stuff and have a timid
suggestion that I'd like some feedback on before I actually write
the trivial (?) patch to do it.
EGCS on OpenServer generates either COFF or ELF. For ELF, we want
DWARF2 exception handling because that's what the people that know
about such things say we want. For COFF, we run into two problems
with the native assembler.
1) The section names are too long. I have submitted a patch to cure
this.
2) The DWARF2 stuff (reasonably) expects an assembler that can handle
forward references.
Since DWARF and COFF don't go together (right?) does it make more sense
for us to just set 'exceptions_via_longjmp' if we're emitting COFF?
Some preliminary poking around in the 924 snapshot shows that if I just
set this variable either via the debugger or via -fsjlj-exceptions while
generating COFF, we don't trigger the lameness in the assembler which
eliminates both of the above problems.
To do this, we need a way that the target files (ala sco5.h) can whack
this variable at runtime.
Would it be reasonable to provide a line in, say, init_eh() that could
override the constant initialization of exceptions_via_longjmp at the
top of exception.c? Then we could stick something like
#define DEFAULT_SJLJ_EXCEPTION \
(TARGET_ELF) ? 0 : 1
in the affected targets.
In an appropriate place (init_eh()?) we could then say
#if defined (DEFAULT_SJLJ_EXCEPTION)
exceptions_via_longjmp = DEFAULT_SJLJ_EXCEPTION ;
#endif
We can't do it where this variable is now being set becuase it has
to be a constant.
Is there a better way to do this? It looks like resetting it
in init_eh() works for at least the trivial case.
Thanx in advance.
--
Robert Lipe http://www.dgii.com/people/robertl robertl@dgii.com
More information about the Gcc
mailing list