Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 455714 - gdb shows wrong source code.
Summary: gdb shows wrong source code.
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gdb
Version: 4.0
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Jan Kratochvil
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2008-07-17 11:13 UTC by Yoshihiro Kagawa
Modified: 2008-07-29 08:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2008-07-29 08:29:57 UTC
Target Upstream Version:

Attachments (Terms of Use)
Reproducer (deleted)
2008-07-17 11:13 UTC, Yoshihiro Kagawa
no flags Details

Description Yoshihiro Kagawa 2008-07-17 11:13:17 UTC
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/
   $ ./

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 11:13:17 UTC
Created attachment 312032 [details]

Comment 2 Jan Kratochvil 2008-07-29 08:29:57 UTC
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/".
Breakpoint 1 at 0x400807: file, line 17.

Breakpoint 1, gdb_tp () at
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.