Bug 455714 - gdb shows wrong source code.
gdb shows wrong source code.
Status: CLOSED WORKSFORME
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gdb (Show other bugs)
4.0
x86_64 Linux
low Severity medium
: rc
: ---
Assigned To: Jan Kratochvil
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-17 07:13 EDT by Yoshihiro Kagawa
Modified: 2008-07-29 04:29 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-29 04:29:57 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)
Reproducer (747 bytes, application/octet-stream)
2008-07-17 07:13 EDT, Yoshihiro Kagawa
no flags Details

  None (edit)
Description Yoshihiro Kagawa 2008-07-17 07:13:17 EDT
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?
Comment 1 Yoshihiro Kagawa 2008-07-17 07:13:17 EDT
Created attachment 312032 [details]
Reproducer
Comment 2 Jan Kratochvil 2008-07-29 04:29:57 EDT
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.

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