Bug 606660
| Summary: | print only shows the first member of a class if that member has any virt. method | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | David Tardon <dtardon> | ||||||||
| Component: | gdb | Assignee: | Jan Kratochvil <jan.kratochvil> | ||||||||
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||
| Severity: | medium | Docs Contact: | |||||||||
| Priority: | low | ||||||||||
| Version: | rawhide | CC: | jan.kratochvil, pmuldoon, swagiaal | ||||||||
| Target Milestone: | --- | ||||||||||
| Target Release: | --- | ||||||||||
| Hardware: | All | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | gdb-7.1-27.fc13 | Doc Type: | Bug Fix | ||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | |||||||||||
| : | 609218 (view as bug list) | Environment: | |||||||||
| Last Closed: | 2010-06-30 15:09:31 UTC | Type: | --- | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Bug Depends On: | |||||||||||
| Bug Blocks: | 609218 | ||||||||||
| Attachments: |
|
||||||||||
Created attachment 425847 [details]
reproducer
Created attachment 425849 [details]
gdb script to run the reproducer
I do not have the problem reproducible, it always prints:
$1 = {m_i = 0, m_base = {_vptr.base = 0x400830}}
It works the same even with `set print object on' removed as `obj' has both the declared type `wrapper' and the instance has also the rtti type `wrapper'.
Tested all the combinations of:
gdb-7.1-26.fc13.x86_64
GNU gdb (GDB) 7.1.50.20100625-cvs
gcc-c++-4.4.4-2.fc13.x86_64
gcc-c++-4.4.4-8.fc13.x86_64
g++ (GCC) 4.4.5 20100625 (prerelease)
These have a problem but this is outside of the Fedora BZ scope:
g++ (GCC) 4.5.1 20100625 (prerelease)
g++ (GCC) 4.6.0 20100625 (experimental)
It fails here with gdb-7.1-26.fc13.x86_64 gcc-4.4.4-8.fc14.x86_64 . As a matter of fact, I saw the same problem before ~4 months, but did nothing about it then. (In reply to comment #4) > It fails here with > > gdb-7.1-26.fc13.x86_64 > gcc-4.4.4-8.fc14.x86_64 Works even with these versions (forgot this is filed against Rawhide). Please provide best the .s output and also the binary: g++ -g3 -S -o print-class.s print-class.cc BTW suggesting in this case s/-g3/-Wall -g/. Created attachment 426861 [details]
correct reproducer
I'm sorry for the confusion...
Post for FSF GDB: http://sourceware.org/ml/gdb-patches/2010-06/msg00615.html gdb-7.1-27.fc13 has been submitted as an update for Fedora 13. http://admin.fedoraproject.org/updates/gdb-7.1-27.fc13 gdb-7.1-27.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report. |
Description of problem: If there is a C++ class whose first member is of a class type and the class of the member has at least one virt. function, and if "print objects is on, then any print of an object of that class prints only its first member. (Huh, well, not so much of a description... but the sample reproducer should be more comprehensive .-) Version-Release number of selected component (if applicable): gdb-7.1-26.fc13.x86_64 How reproducible: always Steps to Reproduce: 1. g++ -g3 -o print-class print-class.cc 2. gdb -nx -x print-class.gdb ./print-class 3. observe the result Actual results: $1 = (base) {_vptr.base = 0x400810} Expected results: $1 = {m_base = {_vptr.base = 0x400810}, m_i = 0}