This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Re-implement VEC_* to be member functions of vec_t<T>
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, Lawrence Crowl <crowl at google dot com>, Richard Guenther <rguenther at suse dot de>
- Date: Fri, 24 Aug 2012 11:06:15 +0000
- Subject: Re: Re-implement VEC_* to be member functions of vec_t<T>
- References: <20120824030813.GA10839@google.com>
On Thu, 23 Aug 2012, Diego Novillo wrote:
> I think I would like to explore the idea of implement a stack
> unwinder that's used by gcc_assert(). This way: (a) we do not
> need to uglify all the APIs with these extra arguments, (b) we
> can control how much of the call stack we show on an assertion.
>
> Would that be something difficult to implement? I don't think we
> need something as generic as libunwind. Thoughts?
Stack unwinding is heavily host-specific. For example, on glibc hosts you
can use backtrace () - but for many architectures this requires you to
build with unwind tables enabled. To convert the addresses to function
names you can use backtrace_symbols () - but that requires the program to
be linked with -rdynamic so that the symbols are in the dynamic symbol
table. (A plugin-enabled compiler will be linked with -rdynamic anyway.)
Other hosts may or may not have such interfaces. In the presence of
inlining, such interfaces may give less helpful results - and in any case
they seem unlikely to give source line numbers, just function names.
--
Joseph S. Myers
joseph@codesourcery.com