Bug 500844 - GCC Generates debug symbols that map two sets of instructions to the closing line of the function.
GCC Generates debug symbols that map two sets of instructions to the closing ...
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc (Show other bugs)
ia64 Linux
medium Severity medium
: rc
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2009-05-14 10:00 EDT by Casey Dahlin
Modified: 2014-06-18 04:46 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-14 15:48:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Casey Dahlin 2009-05-14 10:00:27 EDT
Created attachment 343969 [details]

Description of problem:
When stepping through a function compiled with gcc 3.4.6-10 on gdb, 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

How reproducible:

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
(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);
Comment 2 RHEL Product and Program Management 2010-10-22 15:05:43 EDT
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.