public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Using EH from C
@ 2004-05-02  4:39 david daney
  2004-05-02  9:17 ` Stelios Xanthakis
  0 siblings, 1 reply; 13+ messages in thread
From: david daney @ 2004-05-02  4:39 UTC (permalink / raw)
  To: Stelios Xanthakis, Richard Henderson; +Cc: gcc

On Sat, 1 May 2004, Richard Henderson wrote:

>> On Sat, May 01, 2004 at 05:09:23PM +0300, Stelios Xanthakis wrote:
>> > But of little use without another extension to create landing pads...:(
>>
>> Why in the world would you need that?

>Because if there's no landing pad, _Unwind_RaiseException
>ends up on abort()?
>
>I may be totally wrong, but what I'm trying to do is implement
>"stack unwind with cost-free cleanups from C".
>
>That's three things
>
>1. register destructors on EH
>  Done: attribute(cleanup(function))
>
>2. call 'throw'
>  Done: libgcc_eh and unwind.h
>
>3. set up a landing pad somewhere (try-catch).
>  ???
>
>Where does _Unwind stop otherwise? main()?
>
>~S


gcc/testsuite/gcc.dg/cleanup9.c kind of does what you are talking about.  I would setjump and set an attfibute(cleanup(function)) at the catch point, and then longjump from the cleanup function.
 
Why can't you use C++ for the try/catch part?  Since all of this is GCC specific, if you have C and excpetions working it doesn't seem like using G++ would be a problem.
 
David Daney.
 

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Using EH from C
@ 2004-04-29 12:51 Stelios Xanthakis
  2004-04-29 22:46 ` Richard Henderson
  0 siblings, 1 reply; 13+ messages in thread
From: Stelios Xanthakis @ 2004-04-29 12:51 UTC (permalink / raw)
  To: gcc


Hi.

I'm working on a 'C++ to C' code generator and I'm trying
to figure out (how|if) it's possible to use unwind info from
C programs. The main challenge is 'calling destructors on unwind
with no performance cost if  no exception is raised'. This probably
means that we will have to construct unwind tables manually
by getting the addresses of labels and putting them in  special
sections. And the -funwind-tables?

If anybody knows, please contact me.

Thanks and sorry for the OT but this seems
to be a quiet period on the list, I couldn't find any
info on google and Aldy said I should ask here.

stelios


- The project is [http://students.ceid.upatras.gr/~sxanth/lwc]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-05-03 16:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-02  4:39 Using EH from C david daney
2004-05-02  9:17 ` Stelios Xanthakis
2004-05-03 11:18   ` Stelios Xanthakis
2004-05-03 16:32     ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2004-04-29 12:51 Stelios Xanthakis
2004-04-29 22:46 ` Richard Henderson
2004-04-30  2:35   ` Giovanni Bajo
2004-04-30  3:15     ` Richard Henderson
2004-04-30  3:36       ` Mike Stump
2004-04-30 16:10   ` Stelios Xanthakis
2004-05-01 14:09     ` Stelios Xanthakis
2004-05-01 18:13       ` Richard Henderson
2004-05-02  2:12         ` Stelios Xanthakis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).