Bug 582052
Summary: | gdb can't print std::string | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | igor.redhat <igor.redhat> | ||||||
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: | 12 | CC: | jan.kratochvil, pmuldoon | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | x86_64 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | gdb-7.0.1-44.fc12 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2010-04-15 03:12:21 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: | |||||||||
Attachments: |
|
Description
igor.redhat@gmail.com
2010-04-14 00:15:24 UTC
Created attachment 406386 [details]
quick hack of a patch
For those who need a quick patch to make this work before a proper fix is available, the attached one fixed the problem for me. YMMV.
lazy_string() does not appear to be in the F12 GDB Python API, but the libstdc++ printers use it. The solution here is either to temporarily revert to using string() or import a newer GDB from upstream. This bug was caused by (my) request for Jan to import the std::tuple printer into F12. This brought with in this one unwanted change in as well. GCC patch that changed std::string from using string to lazy_string: http://gcc.gnu.org/viewcvs?view=revision&revision=155951 diff: http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/python/libstdcxx/v6/printers.py?r1=155951&r2=155950&pathrev=155951 Jan, maybe you can reverse the string -> lazy_strings patch for F12? Thanks, verified as applicable: (gdb) p str $1 = Traceback (most recent call last): File "/usr/lib64/../share/gdb/python/libstdcxx/v6/printers.py", line 549, in to_string return self.val['_M_dataplus']['_M_p'].lazy_string (length = len) AttributeError: 'gdb.Value' object has no attribute 'lazy_string' -> (gdb) p str $1 = "foobar" gdb-7.0.1-44.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/gdb-7.0.1-44.fc12 gdb-7.0.1-44.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report. |