Description of problem: gdb shows wrong source code. (on x86_64 server) Version-Release number of selected component (if applicable): gdb-6.3.0.0-1.132.EL4 gcc-3.4.6-3.1 How reproducible: Always. Steps to Reproduce: 1. $ tar -zxf gdb_test.tgz It appears directory, gdb_test. 2. make $ cd gdb_test/ $ ./gdbtest_automake.sh 4. Set environment variable. $ export LD_LIBRARY_PATH=`pwd` 5. Exec binary. $ gdb gdb_tp Actual results: 1. (gdb) b 17 2. (gdb) run 3. (gdb) s In this example, gdb should show c++ constructor's source code. gdb showed wrong code. For instance, my actual results are showed the following... 0x0000002a95557c9c in test_class::test_class () at /usr/lib/gcc/x86_64-linux/3.4.6/../../../../include/c++/3.4.6/bits/locale_facets.tcc:2443 Expected results: 1. (gdb) b 17 2. (gdb) run 3. (gdb) s gdb should show c++ constructor source code. Additional info: I tried to identify an affecting patch in the source rpm. When I removed gdb-6.3-ppc64section-20041026.patch, it worked as I expected. I don't understand the meaning of this patch, yet. I appreciate if anyone kindly explains me more abount this patch. Is this patch needed for x86_64 server? Or only for ppc64 arch? Is there any reason why the patch was not merged into GNU-gdb?
Created attachment 312032 [details] Reproducer
On F-9 x86_64: $ cat >cmd file ./gdb_tp b 17 r $ LD_LIBRARY_PATH=`pwd` /tmp/gdb-6.3.0.0-1.132.EL4.x86_64/usr/bin/gdb -silent -x ./cmd Using host libthread_db library "/lib64/libthread_db.so.1". Breakpoint 1 at 0x400807: file gdb_tp.cc, line 17. Breakpoint 1, gdb_tp () at gdb_tp.cc:17 17 p_class = new test_class(); (gdb) q gcc-4.3.1-4.x86_64 libstdc++-4.3.1-4.x86_64 On RHEL-4 please try to use rather `gcc4'. Also the tested GDB release is very old, recent RHEL-4 release is gdb-6.3.0.0-1.159.el4. > Is there any reason why the patch was not merged into GNU-gdb? Please ask upstream, there is not enough workforce to review all the incoming patches. Please submit a RHEL-4 request ticket through your RHEL-4 service contract.