This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Exception Traceback / Frame Unwind 2
- From: Bud Davis <bdavis at f77 dot linksysnet dot com>
- To: Ben Clewett <Ben dot Clewett at roadrunner dot uk dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 4 Mar 2004 07:15:33 -0600
- Subject: Re: Exception Traceback / Frame Unwind 2
- References: <40470DD6.5030606@roadrunner.uk.com>
If you are using glibc, they have a mechanism for retreiving the
call stack and printing out the information. Here is a portion
of the info page:
Backtraces
==========
A "backtrace" is a list of the function calls that are currently
active in a thread. The usual way to inspect a backtrace of a program
is to use an external debugger such as gdb. However, sometimes it is
useful to obtain a backtrace programmatically from within a program,
e.g., for the purposes of logging or diagnostics.
Is this what you are looking for ?
regards,
bud davis
On Thu, Mar 04, 2004 at 11:07:02AM +0000, Ben Clewett wrote:
> Sorry to labor a point. As an extension to my posting yesterday, our
> need to access Frame Unwind information.
>
> We also host a great many CGI programs, compiled under gcc.
> Occasionally these thrown an exception which cannot be handled. Eg, a
> miss-coded SQL statement. Since these programs run thousands of times a
> day (sometimes!), it's impossible to examine core files. Especially if
> a general 'catch' then exits gracefully without leaving a core :)
>
> Again, it would be enormously useful to access the frame unwind
> programatically. Our CGI programs could then report their errors to our
> programming dept, including the most useful bit of data: Where the
> error occurred in the code, and hence drastically increase the quality
> of our products.
>
> Again, thanks big time to any person who can suggest a solution for us.
>
> Regards,
>
> Ben Clewett.