public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Gokhan Kisacikoglu <kisa@centropolisfx.com>
To: Alexy Khrabrov <alexy.khrabrov@setup.org>
Cc: gcc-help@gcc.gnu.org
Subject: Re: converting signals to C++ exceptions
Date: Mon, 22 Jul 2002 15:36:00 -0000	[thread overview]
Message-ID: <3D3C8982.C75784D0@centropolisfx.com> (raw)
In-Reply-To: <200207222101.g6ML1dq14504@angle.badbox.com>

I am not sure this can be done. Unix signals are handled by service
functions that you install prior, they are invoked regardless the state
of your program (even though it is more than likely that your program is
causing the signal other than few system resource problems). So, once
the signal is handled by your handler function, it will not return where
your program was left off, the handler function decides on what to do
next -most of the time your program is expected to exit anyway. Hence,
it is probably not possible to apply a catch method, because the unix OS
would not know which catch to call when your handler function returns
-there can be several instances in the memory that could handle-, but
you can call the same clean up functions that you would call at the
catch construct from the handler function -basically, you just need to
keep few globals around to find out the leaking data or the data to be
recovered...

HTH,
Gokhan

Alexy Khrabrov wrote:
> 
> Is there a reasonable way to convert Unix signals
> to C++ exceptions on Linux with g++?
> 
> Cheers,
> Alexy

  reply	other threads:[~2002-07-22 22:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-22 14:03 Alexy Khrabrov
2002-07-22 15:36 ` Gokhan Kisacikoglu [this message]
2002-07-22 23:33   ` Todd Kokoszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D3C8982.C75784D0@centropolisfx.com \
    --to=kisa@centropolisfx.com \
    --cc=alexy.khrabrov@setup.org \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).