public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jan dot kratochvil at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/36690]  New: .debug_line first line is behind the first instruction
Date: Tue, 01 Jul 2008 15:35:00 -0000	[thread overview]
Message-ID: <bug-36690-12292@http.gcc.gnu.org/bugzilla/> (raw)

So far -O0 code could be safely debugged.  With 4.3.1 and HEAD if you `break
func' in GDB the breakpoint can be missed despite the function got executed. 
The line number info is wrong and as GCC does not produce prologue-end GDB is
using the line number information to skip the prologue.

Version-Release number of selected component (if applicable):
gcc-4.3.1-3.x86_64 (Fedora 9, broken)
Fedora 8 was correct: gcc-4.1.2-33.x86_64
Verified as broken on:
GNU C (GCC) version 4.4.0 20080701 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 3.4.6 20060404 (Red Hat 3.4.6-9), GMP version
4.2.2, MPFR version 2.3.0-p2.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

Steps to Reproduce:
cat >whilemain.c <<EOH
int i;

void func (void)
{
  while (i == 1)
    i = 0;
}
EOH
gcc -c -o whilemain.o whilemain.c -Wall -g

new broken gccs:
000000000040047c <func>:
int i;

void func (void)
{
  40047c:       55                      push   %rbp
  40047d:       48 89 e5                mov    %rsp,%rbp
  400480:       eb 0a                   jmp    40048c <func+0x10>
  while (i == 1)
    i = 0;
  400482:       c7 05 fc 03 20 00 00    movl   $0x0,0x2003fc(%rip)        #
600888 <i>
  400489:       00 00 00 

gcc-4.1.2-33.x86_64 (Fedora 8):
0000000000400468 <func>:
int i;

void func (void)
{
  400468:       55                      push   %rbp
  400469:       48 89 e5                mov    %rsp,%rbp
  while (i == 1)
  40046c:       eb 0a                   jmp    400478 <func+0x10>
    i = 0;
  40046e:       c7 05 fc 03 20 00 00    movl   $0x0,0x2003fc(%rip)        #
600874 <i>
  400475:       00 00 00


-- 
           Summary: .debug_line first line is behind the first instruction
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jan dot kratochvil at redhat dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36690


             reply	other threads:[~2008-07-01 15:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-01 15:35 jan dot kratochvil at redhat dot com [this message]
2008-07-01 15:53 ` [Bug debug/36690] [4.3/4.4 Regression] " jsm28 at gcc dot gnu dot org
2008-07-02  9:23 ` jakub at gcc dot gnu dot org
2008-07-10 12:02 ` jakub at gcc dot gnu dot org
2008-07-10 13:44 ` hubicka at ucw dot cz
2008-07-10 14:28 ` rguenth at gcc dot gnu dot org
2008-08-27 22:13 ` jsm28 at gcc dot gnu dot org
2008-10-03  8:56 ` jakub at gcc dot gnu dot org
2008-10-07 18:51 ` jakub at gcc dot gnu dot org
2008-10-07 19:02 ` jakub at gcc dot gnu dot org
2008-10-10  7:29 ` cnstar9988 at gmail dot com
2008-11-21 23:49 ` pinskia at gcc dot gnu dot org

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=bug-36690-12292@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).