Re: GCC stack backtraces

2012-08-29 Thread Janne Blomqvist
On Wed, Aug 29, 2012 at 10:22 AM, Ian Lance Taylor wrote: > I've spent the last couple of days working on a stack backtrace library. > > It uses the GCC unwind interface to collect a stack trace, and parses > DWARF debug info to get file/line/function information. [snip] > I expect to use this cod

Re: GCC stack backtraces

2012-08-29 Thread Gabriel Dos Reis
On Wed, Aug 29, 2012 at 2:22 AM, Ian Lance Taylor wrote: > Does this seem like something we could usefully add to GCC? Emphatically, yes!. > Does anybody see any big problems with it? Can it would be a great addition to libstdc++ as a GNU extension, stached in the namespace. I do also do li

Re: GCC stack backtraces

2012-08-29 Thread Basile Starynkevitch
On Wed, Aug 29, 2012 at 02:47:18AM -0500, Gabriel Dos Reis wrote: > On Wed, Aug 29, 2012 at 2:22 AM, Ian Lance Taylor wrote: > > > Does this seem like something we could usefully add to GCC? > > Emphatically, yes!. I also think it would be very useful. BTW, MELT has also such a feature (which

Re: GCC stack backtraces

2012-08-29 Thread Paweł Sikora
On Wednesday 29 of August 2012 00:22:55 Ian Lance Taylor wrote: > I've spent the last couple of days working on a stack backtrace library. > > It uses the GCC unwind interface to collect a stack trace, and parses > DWARF debug info to get file/line/function information. (Of course it's > silly to

Re: GCC stack backtraces

2012-08-29 Thread Basile Starynkevitch
On Wed, Aug 29, 2012 at 10:07:30AM +0200, Paweł Sikora wrote: > On Wednesday 29 of August 2012 00:22:55 Ian Lance Taylor wrote: > > I've spent the last couple of days working on a stack backtrace library. > > > > It uses the GCC unwind interface to collect a stack trace, and parses > > DWARF debug

detecting if cross-compiler (in plugin)?

2012-08-29 Thread Basile Starynkevitch
Hello All, What is the simplest way, for a plugin (and also for a GCC branch), to detect if the compiler is straight or not (i.e. cross, that is target & host are different, or even canadian-cross). I was thinking of some macro in auto-host.h or other header. (MELT is, during its building proc

RE: ICE with MEM_REF when Pmode is different from word_mode

2012-08-29 Thread Deepti Sharma
Hello Richard, > -Original Message- > From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On Behalf Of > Richard Guenther > Sent: 31 May 2012 14:27 > To: Mohamed Shafi > Cc: GCC; d...@redhat.com; Ahmed Sherif > Subject: Re: ICE with MEM_REF when Pmode is different from word_mode >

trunk merged into MELT branch after C++ conversion

2012-08-29 Thread Basile Starynkevitch
Hello All, I just successfully merged the trunk (future GCC 4.8) svn rev 190745 into the MELT (www.gcc-melt.org) branch (svn rev 190778). In particular, this meant merging the C++ conversion into the MELT branch. That merge was a bit painful, because of the C -> C++ conversion. Most of the pain

Re: trunk merged into MELT branch after C++ conversion

2012-08-29 Thread Marc Glisse
On Wed, 29 Aug 2012, Basile Starynkevitch wrote: I discovered a strange property of C++ regarding symbols. If you just code // file foo1.cc extern "C" { const int twosymb=2; }; the resulting foo1.o does not define a twosymb symbol (I expected that it does). You have to code // fil

Re: GCC stack backtraces

2012-08-29 Thread Michael Matz
Hi, On Wed, 29 Aug 2012, Ian Lance Taylor wrote: > Does this seem like something we could usefully add to GCC? Does > anybody see any big problems with it? Does it work without unwind tables? I suspect it doesn't as it's using libgccs unwinder, so that would be a problem if we were to use it

Re: GCC stack backtraces

2012-08-29 Thread Frank Ch. Eigler
Basile Starynkevitch writes: > [...] If Ian's DWARF reader is simple enough (since suited for a > single purpose), it might be helpful to avoid yet another external > library dependency for GCC. [...] OTOH, DWARF is not a stationary target, so one should consider the benefits of offloading fors

Re: GCC stack backtraces

2012-08-29 Thread Ian Lance Taylor
On Wed, Aug 29, 2012 at 6:27 AM, Michael Matz wrote: > > On Wed, 29 Aug 2012, Ian Lance Taylor wrote: > >> Does this seem like something we could usefully add to GCC? Does >> anybody see any big problems with it? > > Does it work without unwind tables? I suspect it doesn't as it's using > libgcc

Re: GCC stack backtraces

2012-08-29 Thread Ian Lance Taylor
On Wed, Aug 29, 2012 at 12:43 AM, Janne Blomqvist wrote: > On Wed, Aug 29, 2012 at 10:22 AM, Ian Lance Taylor wrote: >> I've spent the last couple of days working on a stack backtrace library. >> >> It uses the GCC unwind interface to collect a stack trace, and parses >> DWARF debug info to get f

Re: GCC stack backtraces

2012-08-29 Thread H.J. Lu
On Wed, Aug 29, 2012 at 9:21 AM, Ian Lance Taylor wrote: > On Wed, Aug 29, 2012 at 12:43 AM, Janne Blomqvist > wrote: >> On Wed, Aug 29, 2012 at 10:22 AM, Ian Lance Taylor wrote: >>> I've spent the last couple of days working on a stack backtrace library. >>> >>> It uses the GCC unwind interface

Re: GCC stack backtraces

2012-08-29 Thread David Daney
On 08/29/2012 12:43 AM, Janne Blomqvist wrote: On Wed, Aug 29, 2012 at 10:22 AM, Ian Lance Taylor wrote: I've spent the last couple of days working on a stack backtrace library. It uses the GCC unwind interface to collect a stack trace, and parses DWARF debug info to get file/line/function inf

Re: GCC stack backtraces

2012-08-29 Thread Ian Lance Taylor
On Wed, Aug 29, 2012 at 1:07 AM, Paweł Sikora wrote: > On Wednesday 29 of August 2012 00:22:55 Ian Lance Taylor wrote: >> I've spent the last couple of days working on a stack backtrace library. >> >> It uses the GCC unwind interface to collect a stack trace, and parses >> DWARF debug info to get

Re: GCC stack backtraces

2012-08-29 Thread Toon Moene
On 08/29/2012 06:21 PM, Ian Lance Taylor wrote: The DWARF reader calls malloc and is therefore not async-signal safe. It also is a problem if the crash in the program is due to overwriting the malloc heap administration (which easily occurs in Fortran if you overwrite bounds of allocatable a

Re: GCC stack backtraces

2012-08-29 Thread Paweł Sikora
On Wednesday 29 of August 2012 11:37:07 Ian Lance Taylor wrote: > On Wed, Aug 29, 2012 at 1:07 AM, Paweł Sikora wrote: > > On Wednesday 29 of August 2012 00:22:55 Ian Lance Taylor wrote: > >> I've spent the last couple of days working on a stack backtrace library. > >> > >> It uses the GCC unwind

Re: GCC stack backtraces

2012-08-29 Thread Ian Lance Taylor
On Wed, Aug 29, 2012 at 9:31 AM, H.J. Lu wrote: > On Wed, Aug 29, 2012 at 9:21 AM, Ian Lance Taylor wrote: >> >> I believe the unwinder proper is async signal safe--it just uses >> _Unwind_Backtrace. >> >> The DWARF reader calls malloc and is therefore not async-signal safe. >> It would be diffic

Re: GCC stack backtraces

2012-08-29 Thread Ian Lance Taylor
On Wed, Aug 29, 2012 at 11:45 AM, Paweł Sikora wrote: > On Wednesday 29 of August 2012 11:37:07 Ian Lance Taylor wrote: >> On Wed, Aug 29, 2012 at 1:07 AM, Paweł Sikora wrote: >> > On Wednesday 29 of August 2012 00:22:55 Ian Lance Taylor wrote: >> >> I've spent the last couple of days working on

Re: detecting if cross-compiler (in plugin)?

2012-08-29 Thread Ian Lance Taylor
On Wed, Aug 29, 2012 at 1:59 AM, Basile Starynkevitch wrote: > > What is the simplest way, for a plugin (and also for a GCC branch), > to detect if the compiler is straight or not (i.e. cross, that is > target & host are different, or even canadian-cross). > > I was thinking of some macro in auto-