Red Hat Bugzilla – Bug 500844
GCC Generates debug symbols that map two sets of instructions to the closing line of the function.
Last modified: 2014-06-18 04:46:43 EDT
Created attachment 343969 [details]
Description of problem:
When stepping through a function compiled with gcc 3.4.6-10 on gdb 188.8.131.52-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):
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
5. Executing the next or step sub command repeatedly
(Please see the "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.
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
6 } ... The "}" is output two times.
main (argc=1, argv=0x60000fffffffbbb8) at testpro.c:14
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.