This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: libbacktrace & plugins....
- From: Basile Starynkevitch <basile at starynkevitch dot net>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 20 May 2013 17:51:13 +0200
- Subject: Re: libbacktrace & plugins....
- References: <20130520143115 dot GA7260 at ours dot starynkevitch dot net> <CAKOQZ8wcheVAS8Mcmk_wYoOcEbCdMT3rL+4wU+b7VU1mNQ-c0w at mail dot gmail dot com>
On Mon, May 20, 2013 at 08:43:06AM -0700, Ian Lance Taylor wrote:
> On Mon, May 20, 2013 at 7:31 AM, Basile Starynkevitch
> <basile@starynkevitch.net> wrote:
> >
> > Currently (for GCC 4.8 at least) when a plugin crashes (ie. SIGSEGV) libbacktrace is apparently not able
> > to show backtrace information inside the plugin[s].
> >
> > I believe that, at least on GNU/Linux wich has dladdr, it would be nice to extend libbacktrace
> > to show backtrace information inside plugins (at least those compiled with -g).
> >
> > Is is reasonably feasible? I'm not familiar with libbacktrace, but (since MELT would be very happy with that)
> > I might perhaps help....
>
> That is actually supposed to work already. The code is in
> libbacktrace/elf.c. It calls dl_iterate_phdr to find all the shared
> libraries loaded into the process. I never tested it with dlopen so I
> can certainly believe that it doesn't work, but I don't know why it
> doesn't work.
Maybe I am wrong (I did not make any testcase for that).
I very rarely have a SIGSEGV in MELT (because usually my own backtrace machinery works well),
and when it happens it usually happens inside MELT generated C code which is dlopened
(and not always compiled with -g) by the melt.so plugin. (so it is not a direct GCC plugin).
Sorry for the noise.
Cheers.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***