This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: traceback feature for gfortran


David Daney writes:
 > Daniel Jacobowitz wrote:
 > > On Fri, Feb 10, 2006 at 09:40:30PM +0100, FX Coudert wrote:
 > > 
 > >>Hi gfortranners,
 > >>
 > >>This proposed patch adds a traceback feature: for code compiled with 
 > >>the -ftrace function, a backtrace of function called is printed after a 
 > >>runtime failure. For now, this is only enable in conjunction of the 
 > >>-ffpe-trap function (by adding a signal handler for SIGFPE), but the 
 > >>framework can be used for any kind of error.

It can't be used for _any_ kind of error, only for synchronous signals.
gcc emits unwinder data only at points where it knows that an
instruction may trap: in practice, this is limited to divide and
memory access instructions, and only when compiling with
-fnon-call-exceptions.

In particular, wo do not emit precise unwinder data during prologues.

 > >>All kinds of comments appreciated. This is not yet a formal patch 
 > >>proposal, I'm just asking for feedback about the feature, the way it is 
 > >>implemented, the english, anything!
 > > 
 > > 
 > > Haven't we got enough different ways to do backtraces already?  I'd
 > > think you could do this by enabling unwind tables and using the
 > > libgcc/libunwind interface.  And then it goes through other
 > > languages...
 > 
 > Gcj/libgcj has extensive support for this on many different platforms. 
 > This already interacts seamlessly with g++.  I don't know what is 
 > involved in making the gfortran front-end use the same mechanism, but it 
 > seems to me that it would make sense.

Indeed.  There is some code required to unwind correctly through the
signal handler frame.  It would be good for fortran not to invent all
this again.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]