[C++-sig] Re: sub module support in V2

Dave Hawkes daveh at cadlink.com
Sun Jun 9 04:17:36 CEST 2002


"David Abrahams" <david.abrahams at rcn.com> wrote in message
news:243a01c20f1e$cf832870$6601a8c0 at boostconsulting.com...
>
> Sorry to be nitpicky, but I don't like that interface. Any interface which
> introduces new macro cruft /and/ requires that the cruft be in the same TU
> with BOOST_PYTHON_MODULE_INIT() seems like it provides too few advantages
> to offset its drawbacks. Why not just have the main init function call the
> other init functions?
>

I realised that this functionality can be easily split into a module totally
separate from boost, so I'll do that and keep it for my own use where I have
dozens of source files in a single project that I need to create boost
support for. It just saves creating and keeping track of a large number of
initialisation calls.

> > > What about _set_se_translator?
> > >
> >
> > Doesn't help, it turns SEH exceptions into c++ exceptions
>
> No, it doesn't have to. It just lets you hook SEH throwing at the
innermost
> level.
>

Initially I though this would be a problem as the handler that this installs
has no facility to continue in itself and if it returns it will just pass
the excepion upwards again...

However, I did some tests and found that by catching a structured exception,
then rethrowing a C++ exception, catching it and then rethrowing it within a
c++ handler will rethrow it as SE allowing it to be caught by an upper SEH
and then continued without error! Unfortunately I can find no documentation
that says this should work, but then I can find none that says it shouldn't.

I've attached my quick and dirty test project so its clear what I did. The
end conclusion is that we just need another catch prior to the catch(...)
that will catch a specific seh_filter class that we define. Then all the
user has to do is call _set_se_translator themselves with a simple handler
that throws the seh_filter class, rather than set the handler within boost.
That way we avoid contaminating boost with MS specific SEH code. Also if the
user is already using _set_se_translator they can integrate their support
and boosts support.

> > at which point
> > they become non-continuable which is what we are trying to avoid in the
> > first place. Also I believe the SEH frame is corrupt after the c++ catch
> so
> > it would be difficult to rethrow an SEH exception at that point that
> could
> > be continued from it point of origin.
>
> What catch? I'm just talking about installing some kind of handler with
> _set_se_translator so that these continuable things are dealt with instead
> of turning them into unwinding.
>

see above.

Dave Hawkes



begin 666 ex_test.zip
M4$L#!!0````(`+>NR"QM,:<FP@,``,D(```3````97A?=&5S="]E>%]T97-T
M+F-P<)56;6_;-A#^7 /^#[<.*^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$J&[H!!'K)V5Q2]K4O,&%-QRZSC'*29;$R<Q'*)'(`B*,
M"\@,H9B+0J"XBG.4,KO.T\E4((KGXLAU=L7_U7XRU?Q(E?4QH+<[2\8.`F_Q
M>7HKT^(4J:K6ZH$@7S>D at _'H\KWW80;C\]W;=9WK]'W_)1A]"WZB^:/VD[.&
MEZKQ?\=S=GB>+5!+`0(4"Q0````(`+>NR"QM,:<FP@,``,D(```3````````
M``$`( ````````!E>%]T97-T+V5X7W1E<W0N8W!P4$L!`A0+% ````@`U*[(
M+ A.+8M?! ``Q1$``!,``````````0`@````\P,``&5X7W1E<W0O97A?=&5S
M="YD<W!02P$"% L4````" !!FL at LC@F#W=0````9`@``$P`````````!`" `
M``"#" ``97A?=&5S="]E>%]T97-T+F1S=U!+!08``````P`#`,,```"("0``
"````
`
end








More information about the Cplusplus-sig mailing list