Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gcc@gcc.gnu.org, libc-alpha@sources.redhat.com,
		gdb@sourceware.org, Jakub Jelinek <jakub@redhat.com>,
		Richard Henderson <rth@redhat.com>
Subject: Re: Unwinding CFI gcc practice of assumed `same value' regs
Date: Wed, 13 Dec 2006 18:10:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.0612131905510.29962@wotan.suse.de> (raw)
In-Reply-To: <20061211190300.GA4372@host0.dyn.jankratochvil.net>

Hi,

On Mon, 11 Dec 2006, Jan Kratochvil wrote:

> currently (on x86_64) the gdb backtrace does not properly stop at the outermost
> frame:
> 
> #3  0x00000036ddb0610a in start_thread () from /lib64/tls/libpthread.so.0
> #4  0x00000036dd0c68c3 in clone () from /lib64/tls/libc.so.6
> #5  0x0000000000000000 in ?? ()
> 
> Currently it relies only on clearing %rbp (0x0000000000000000 above is
> unrelated to it, it got read from uninitialized memory).
> 
> http://sourceware.org/ml/gdb/2004-08/msg00060.html suggests frame 
> pointer 0x0 should be enough for a debugger not finding CFI to stop 
> unwinding, still it is a heuristic.  In the -fno-frame-pointer compiled 
> code there is no indication the frame pointer register became a regular 
> one and 0x0 is its valid value.

Right.  Unwinding through functions (without frame pointer) requires CFI.  
If there is CFI for a function the unwinder must not look at %rbp for stop 
condition.  If there's no CFI for a function it can't be unwound (strictly 
per ABI).  If one relaxes that and wants to unwind through CFI-less 
functions it has to have a frame pointer.  In that case zero in that frame 
pointer could indicate the outermost frame (_if_ the suggestion in the ABI 
is adhered to, which noone is required to).


Ciao,
Michael.


      parent reply	other threads:[~2006-12-13 18:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-11 19:03 Jan Kratochvil
2006-12-11 22:40 ` Roland McGrath
2006-12-12 15:54   ` Jakub Jelinek
2006-12-12 13:55 ` Andrew Haley
2006-12-12 14:55   ` Mark Kettenis
2006-12-12 15:04     ` Andrew Haley
2006-12-12 15:21       ` Ulrich Drepper
2006-12-12 15:26         ` Andrew Haley
2006-12-12 15:39           ` Ulrich Drepper
2006-12-13 18:11             ` Michael Matz
2006-12-12 15:50           ` Jan Kratochvil
2006-12-12 16:19           ` Jakub Jelinek
2006-12-12 16:55       ` Ian Lance Taylor
2006-12-12 17:06         ` Andrew Haley
2006-12-12 17:34           ` Mark Kettenis
2006-12-13 18:02           ` Michael Matz
2006-12-13 18:10 ` Michael Matz [this message]

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=Pine.LNX.4.64.0612131905510.29962@wotan.suse.de \
    --to=matz@suse.de \
    --cc=gcc@gcc.gnu.org \
    --cc=gdb@sourceware.org \
    --cc=jakub@redhat.com \
    --cc=jan.kratochvil@redhat.com \
    --cc=libc-alpha@sources.redhat.com \
    --cc=rth@redhat.com \
    /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