[Patch,fortran] Backtrace support (PR30498)

Tobias Burnus burnus@net-b.de
Sat Feb 10 22:19:00 GMT 2007


Hi,

Paul Thomas wrote:
>> That's Cygwin, right? The implementation only works with GLIBC's
>> backtrace() function.
> Yes, I'm afraid so - I did not notice the glibc specificity until
> after the event.

I wonder whether we could make use of libunwind:
  http://savannah.nongnu.org/projects/libunwind
Old webpage (maybe easier to find information):
  http://www.hpl.hp.com/research/linux/libunwind/

This library supports:

 Linux/IA-64:	Fully tested and supported.
 Linux/x86-64:	Works well.
 Linux/x86:	Works well, but C library is missing some unwind-info.
 Linux/PARISC:	Works well, but C library missing unwind-info.
 HP-UX/IA-64:	Mostly works but known to have some serious limitations.

(No, there is no Windows support, and neither do I see FreeBSD et alia
there.)

The library is used - at least on some platforms - by glibc's backtrace()
and also in GCC by for _Unwind_Backtrace.
In libjava there is also a fall back implementation if libunwind is not
available, cf. e.g.
http://gcc.gnu.org/viewcvs/trunk/libjava/sysdep/i386/backtrace.h?view=markup

In any case we should check _Unwind_Backtrace in GCC. Maybe we can do
something smarter and something which works on Windows too.

For Windows, the following looks at least somewhat promising, but I
understand too little about Cygwin/MinGW to know whether it still works
with them:
http://www.nedbatchelder.com/blog/20051006T065335.html

Tobias



More information about the Fortran mailing list