Bug 500844 - GCC Generates debug symbols that map two sets of instructions to the closing line of the function.
Summary: GCC Generates debug symbols that map two sets of instructions to the closing ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc
Version: 4.8
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-05-14 14:00 UTC by Casey Dahlin
Modified: 2018-10-27 14:25 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-14 19:48:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Reproducer (253 bytes, text/plain)
2009-05-14 14:00 UTC, Casey Dahlin
no flags Details

Description Casey Dahlin 2009-05-14 14:00:27 UTC
Created attachment 343969 [details]
Reproducer

Description of problem:
When stepping through a function compiled with gcc 3.4.6-10 on gdb 6.3.0.0-1.159.el4, coming to the end of the function yields odd behavior: when you arrive at the closing curly brace and step, instead of jumping back to the parent function, you are shown the closing curly brace again. I attribute this to bad debug symbols because compiling the test case on RHEL 5 and then debugging it on the same version of gdb on RHEL 4 causes the problem to go away (I'm doing this by linking with -static since the RHEL 5 binary will be incompatible with the RHEL 4 glibc).

This has only been reproduced on ia64. x86_64 does not show this behavior.

Version-Release number of selected component (if applicable):
gcc 3.4.6-10
gdb 6.3.0.0-1.159.el4

How reproducible:
100%

Steps to Reproduce:
This problem can be reproduced by the attached "testpro.c".

1. Compile the reproducer:
  # gcc -g -o testpro testpro.c

2. Run gdb
  # gdb ./testpro

3. Set the Breakpoint
  (gdb) b sub_1

4. run

5. Executing the next or step sub command repeatedly
  (Please see the "Actual Results".)

Actual Results:
"}" is output two times.

<step sub command>
[root@localhost new]# gdb ./testpro
...snip...
(gdb) b sub_1
Breakpoint 1 at 0x4000000000000730: file testpro.c, line 5.
(gdb) run
Starting program: /root/iza/repro/new/testpro
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xa000000000000000
a = 0

Breakpoint 1, sub_1 (a=0x60000fffffffb910) at testpro.c:5
5           *a+=1;
(gdb) step
6       }
(gdb) step
6       }                               ... The "}" is output two times.
(gdb) step
main (argc=1, argv=0x60000fffffffbbb8) at testpro.c:14
14          sub_1(&a);
(gdb)

Comment 2 RHEL Program Management 2010-10-22 19:05:43 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.


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