public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: jose.marchesi@oracle.com (Jose E. Marchesi)
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH][SPARC] sparc: switch -fasynchronous-unwind-tables on by default.
Date: Tue, 15 Mar 2016 16:38:00 -0000	[thread overview]
Message-ID: <87pouvk7th.fsf@oracle.com> (raw)
In-Reply-To: <6828458.u3IJH91KbV@polaris> (Eric Botcazou's message of "Wed, 09	Mar 2016 11:02:53 +0100")


    > Consider the attached test program.  When built with -g in sparc64-*-*
    > the resulting binary contains:
    > 
    > - A .eh_frame segment containing CFA information for __libc_csu_init and
    >   __libc_csu_fini.
    > 
    > - A .debug_frame segment containing CFA information for func2, func1 and
    >   main.
    > 
    > The backtrace(3) implementation for sparc contains a simple unwinder
    > that works well in most cases, but that unwinder is not used if
    > libgcc_s.so can be dlopened and it provides _Unwind_Backtrace.  Now,
    > _Unwind_Backtrace uses .eh_frame but not .debug_frame.  Thus,
    > backtrace(3) is only useful in programs built with
    > -fasynchronous-unwind-tables even if -g provides CFA info in
    > .debug_frame.
    
    How does that work for e.g. PowerPC or MIPS?  Why not do the same for SPARC?

The glibc PowerPC port doesn't use the libgcc_s unwinder to implement
backtrace().  It has a little ad-hoc unwinder.

MIPS is like x86_64: it exclusively relies on libgcc_s _Unwind_Backtrace
to unwind the stack.

As far as I can tell, -fasynchronous-unwind-tables is disabled in MIPS
by default.  Therefore unless -fasynchronous-unwind-tables is used at
build time backtrace() probably has the same problem than sparc (can't
tell for sure, as I don't have access to any mips host where to test).

  reply	other threads:[~2016-03-15 16:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25 21:16 Jose E. Marchesi
2016-02-28 18:35 ` Eric Botcazou
2016-02-29 15:42   ` Jose E. Marchesi
2016-03-09 10:03     ` Eric Botcazou
2016-03-15 16:38       ` Jose E. Marchesi [this message]
2016-03-17 21:17     ` Richard Henderson
2016-03-18  1:07       ` Jose E. Marchesi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pouvk7th.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).