Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Tigran Aivazian <tigran@veritas.com>
Cc: gdb@sources.redhat.com
Subject: Re: gdb problems with -O1 on x86_64 architecture.
Date: Mon, 09 May 2005 16:39:00 -0000	[thread overview]
Message-ID: <20050509163938.GA22498@nevyn.them.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0505091703140.4462@ezer.homenet>

On Mon, May 09, 2005 at 05:11:27PM +0100, Tigran Aivazian wrote:
> Hello,
> 
> I enclosed a small program which shows a bug in gdb --- it coredumps if 
> you try to look at the backtrace. Here is how to reproduce it:
> 
> 1. Compile with -O1 optimization option:
> 
> $ gcc -g -Wall -O1 uvar.c -o uvar-O1

It is unlikely that anyone else can reproduce this, because it depends
on what your compiler is generating.  What version is it?  What patches
are applied?

You may have better luck if you attach a built binary.

> Also, with application compiled with -O0 everything works perfectly. But 
> with -O2 I get most of the function arguments marked as "optimized away". 
> Well, surely they are NOT optimized away, but the debug info is stored in 
> such a way (presumably difficult to decode according to DWARF2 rules) that 
> makes gdb's life very hard to decode them, right? Is there any way to get 
> gdb to see function arguments for the case of -O2 optimization?

No, more likely they are optimized away - not saved because they are no
longer available.  There's no way to be sure without a binary.  In your
test case, they probably _are_ gone.  They are never referenced after
the function calls, so there's no benefit in saving them to the stack
and restoring them later.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


  reply	other threads:[~2005-05-09 16:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-09 16:17 Tigran Aivazian
2005-05-09 16:39 ` Daniel Jacobowitz [this message]
2005-05-09 16:47   ` Tigran Aivazian
2005-05-10 14:32     ` Tigran Aivazian
2005-05-10 14:45       ` Daniel Jacobowitz

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=20050509163938.GA22498@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb@sources.redhat.com \
    --cc=tigran@veritas.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