LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 1982 - Stack backtraces in exceptions not supported
Summary: Stack backtraces in exceptions not supported
Status: RESOLVED FIXED
Alias: None
Product: tools
Classification: Unclassified
Component: gnat (show other bugs)
Version: trunk
Hardware: Other Linux
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-04 14:24 PST by Duncan Sands
Modified: 2012-05-04 06:47 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Sands 2008-02-04 14:24:07 PST
The Ada -E binder option stores a stack traceback in the exception.
This doesn't work with llvm-gcc.  Testcase:

procedure Trace is
begin
   raise Program_Error;
end;

$ gnatmake trace.adb -bargs -E
gcc -c trace.adb
gnatbind -aO./ -E -I- -x trace.ali
gnatlink trace.ali
$ ./trace
Segmentation fault (core dumped)
Comment 1 Anton Korobeynikov 2008-02-23 08:35:24 PST
How such stuff is represented in terms of gcc builtins / llvm IR ?
Comment 2 Duncan Sands 2008-02-23 09:31:29 PST
A quick glance shows it using:

__builtin_frame_address
_Unwind_Backtrace
_Unwind_GetIP
Comment 3 Jay Foad 2012-05-04 06:42:44 PDT
> This doesn't work with llvm-gcc.

Does it work with dragonegg?
Comment 4 Duncan Sands 2012-05-04 06:46:23 PDT
This works with dragonegg.
Comment 5 Jay Foad 2012-05-04 06:47:31 PDT
Cool!