Bug 455714 - gdb shows wrong source code.
gdb shows wrong source code.
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gdb (Show other bugs)
x86_64 Linux
low Severity medium
: rc
: ---
Assigned To: Jan Kratochvil
Depends On:
  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:
Last Closed: 2008-07-29 04:29:57 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 (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):

How reproducible:

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

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]
Comment 2 Jan Kratochvil 2008-07-29 04:29:57 EDT
On F-9 x86_64:
$ cat >cmd
file ./gdb_tp
b 17
$ LD_LIBRARY_PATH=`pwd` /tmp/gdb- -silent -x
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


On RHEL-4 please try to use rather `gcc4'.
Also the tested GDB release is very old, recent RHEL-4 release is

> 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

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.