Bug 452958 - Line number info first line is behind the first instr
Line number info first line is behind the first instr
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
9
x86_64 Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-26 05:08 EDT by Jan Kratochvil
Modified: 2008-07-01 11:35 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-01 11:35:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
The sample code whilemain.c (101 bytes, text/plain)
2008-06-26 05:08 EDT, Jan Kratochvil
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 36690 None None None Never

  None (edit)
Description Jan Kratochvil 2008-06-26 05:08:39 EDT
Description of problem:
So far -O0 code could be safely debugged.  In F9 if you `break func' the
breakpoint can be missed despite the function got executed.

Version-Release number of selected component (if applicable):
gcc-4.3.0-8.x86_64 (F-9, broken)
gcc-4.3.1-3.x86_64 (Rawhide, broken)
F-8 was correct: gcc-4.1.2-33.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. gcc -o whilemain whilemain.c -Wall -ggdb2
2. gdb -ex 'file ./whilemain' -ex 'b func' -ex r 

Actual results:
Program exited normally.

Expected results:
Breakpoint 1, func () at whilemain.c:5
5	  while (i == 1)

Additional info:
Sure a better approach would be a prologue-end marker not being emitted now (Bug
185789).  Still the line number information is wrong.

F-9:
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 

F-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
Comment 1 Jan Kratochvil 2008-06-26 05:08:39 EDT
Created attachment 310316 [details]
The sample code whilemain.c

Note You need to log in before you can comment on or make changes to this bug.