Bug 1259051 - Gdb-heap fails with Python backtrace
Summary: Gdb-heap fails with Python backtrace
Keywords:
Status: CLOSED DUPLICATE of bug 1240340
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb-heap
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dave Malcolm
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-01 20:35 UTC by Göran Uddeborg
Modified: 2016-01-17 13:05 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-01-17 13:05:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Göran Uddeborg 2015-09-01 20:35:42 UTC
Description of problem:
When starting gdb, I get error messages about incorrect Python syntax in gdb-heap/heap/__init__.py

Version-Release number of selected component (if applicable):
gdb-heap-0.5-22.fc23.x86_64


How reproducible:
Every time.


Steps to Reproduce:
1. Create a file with debug information.  E.g.:
cat > c.c << EOF
int main()
{
  return 0;
}

2. Compile with debug information.
cc -g c.c -o c

3. Start gdb on it.
gdb c

4. Set a breakpoint.
b main

5. Run
r


Actual results:
Gdb prints an error message:
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib64/ld-2.22.so-gdb.py", line 18, in <module>
    from heap.commands import register_commands
  File "/usr/share/gdb-heap/heap/__init__.py", line 58
    print 'type cache miss: %r' % typename
                              ^
SyntaxError: invalid syntax


Expected results:
No error message.


Additional info:
To me, this looks very much like a python2/python3 issue.  The print statement is apparently in python2 syntax, but gdb links with the python3 libraries.

If I add parenthesis around the string and variable, I instead get an error message around the except clause two lines further down.  Again, it uses python2 syntax.

From what I can understand, a conversion 2to3 is needed on the Python files in the package.

Comment 1 Jan Kratochvil 2016-01-17 13:05:27 UTC

*** This bug has been marked as a duplicate of bug 1240340 ***


Note You need to log in before you can comment on or make changes to this bug.