[git commit] libubacktrace: use -funwind-tables rather than -fexecptions

Carmelo AMOROSO carmelo.amoroso at st.com
Tue Jan 3 16:34:40 UTC 2012


On 01/01/2012 0.10, Mike Frysinger wrote:
> On Thursday 22 December 2011 13:19:22 Carmelo AMOROSO wrote:
>> On 22/12/2011 15.30, Carmelo Amoroso wrote:
>>> commit: 
>>> http://git.uclibc.org/uClibc/commit/?id=8a8434b367e0b94b9fda72c99f1c6467
>>>
>>> 
37725403 branch:
>>> http://git.uclibc.org/uClibc/commit/?id=refs/heads/master
>>> 
>>> For backtrace to work is enough to use -funwind-tables instead 
>>> of -fexceptions.
>>> 
>>> Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
>> 
>> Indeed, I'm wondering if -fasynchrous-unwind-tables should be
>> used rather then funwind-tables. On my arh SH4 the generated code
>> is exactly the same. I'm not expert of DWARF, neither gcc
>> documentation regarding the differences between -fexceptions,
>> -funwind-tables or -fasynchronous-unwind-tables helped me so
>> much.
>> 
>> someone else has clearer idea ?
> 
> for backtrace, we just want unwind-tables, so using that over
> -fexceptions is good (since we don't have to handle exceptions in
> this code).  as for the async vs non-async unwind-tables, i don't
> know the answer to that. -mike

Thanks Mike for your feedback.

I've reported here below the extract from gcc manual. Reading it
again, it seems to me that using -fasynchronous-unwind-tables is the
best as it's purpose is actually to create the dwarf2 information, in
the other two cases (-fexceptions or -funwind-tables) it seems to be a
side effect.

Make sense ?

Cheers,
Carmelo


-fexceptions
    Enable exception handling. Generates extra code needed to
propagate exceptions. For some targets, this implies GCC will generate
frame unwind information for all functions, which can produce
significant data size overhead, although it does not affect execution.
If you do not specify this option, GCC will enable it by default for
languages like C++ which normally require exception handling, and
disable it for languages like C that do not normally require it.
However, you may need to enable this option when compiling C code that
needs to interoperate properly with exception handlers written in C++.
You may also wish to disable this option if you are compiling older
C++ programs that don't use exception handling.

-funwind-tables
    Similar to -fexceptions, except that it will just generate any
needed static data, but will not affect the generated code in any
other way. You will normally not enable this option; instead, a
language processor that needs this handling would enable it on your
behalf.

-fasynchronous-unwind-tables
    Generate unwind table in dwarf2 format, if supported by target
machine. The table is exact at each instruction boundary, so it can be
used for stack unwinding from asynchronous events (such as debugger or
garbage collector).
> 
> 
> 
> _______________________________________________ uClibc-cvs mailing
> list uClibc-cvs at uclibc.org 
> http://lists.busybox.net/mailman/listinfo/uclibc-cvs



More information about the uClibc-cvs mailing list