Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 609157

Summary: Python (=pretty printing) for GDB
Product: Red Hat Enterprise Linux 5 Reporter: Jan Kratochvil <jan.kratochvil>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact: qe-baseos-tools-bugs
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: dmalcolm, ebachalo, pmuller, psplicha
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gdb-7.0.1-28.el5 Doc Type: Bug Fix
Doc Text:
When debugging a C++ program, GDB displayed values of simple data types as they were implemented. With this update, GDB uses a Python feature to display such values in a human-readable format.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-13 23:54:51 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: 547870, 625372, 644661    

Description Jan Kratochvil 2010-06-29 14:36:52 UTC
Description of problem:
There is a highly visible GDB feature called Python Pretty Printing primarily for user friendly C++ data types displaying.  It has been implemented by Red Hat (primarily Tom Tromey).
http://sourceware.org/gdb/wiki/PythonGdb
http://tromey.com/blog/?cat=17

Version-Release number of selected component (if applicable):
gdb-7.0.1-23.el5

How reproducible:
Always.

Steps to Reproduce:
Have C++ program with:
  std::string s = "abcd";
(gdb) print s

Actual results:
$1 = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x601028 "abcd"}}

Expected results:
$1 = "abcd"

Additional info:
The python support can be enabled on existing gdb-7.0.1-23.el5.src.rpm just by:
rpmbuild --with python
But it requires python libraries in the same arch as GDB which is on powerpc ppc64 for gdb byt ppc (32bit) for python.  Just for this reason RHEL-5.5 currently has --without python for all its arches.

Comment 1 Jan Kratochvil 2010-09-21 23:41:10 UTC
* Tue Sep 21 2010 Jan Kratochvil <jan.kratochvil> - 7.0.1-28.el5
- Enable python by default even in Brew and on all the arches (BZ 609157).
- Resolves: rhbz#609157

Comment 4 Eva Kopalova 2010-11-16 17:13:40 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When debugging a C++ program, GDB displayed values of simple data types as they were implemented. With this update, GDB uses a Python feature to display such values in a human-readable format.

Comment 11 errata-xmlrpc 2011-01-13 23:54:51 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0099.html