GDB is not built with python2 support

Bug #1216660 reported by Petko Ditchev on 2013-08-25
70
This bug affects 14 people
Affects Status Importance Assigned to Milestone
gdb (Ubuntu)
Undecided
Unassigned
qtcreator (Ubuntu)
High
Unassigned

Bug Description

 On the default install GDB is built without the python-dev , or has some other issue disenabling python . I'm not going to pretend I understand the full problem , but Qt Creator did not have proper debugging -> after some digging around and asking I found out that GDB did not work with the python scripts for interpreting STL and QT objects . So I rebuilt it from source (first without - same problem accured , and then) with python-dev , and that resolved the issue .

I'm on the latest dev 13.10 build (upgraded) , freshly installed .

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdb (Ubuntu):
status: New → Confirmed
Søren Holm (sgh) wrote :

I have the exact same problem. Did you patch the debian-package or did you just build it yourself. I'd like to try that also.

Petko Ditchev (pditchev) wrote :

Built it myself - there are tutorials online . You need the dependencies (I was missing some stuff the first time I built it - ncurses lib , python-dev) , but otherwise it's pretty straight forward . Then point QtCreator to the newly installed gdb executable (I think 'make install' puts it in /usr/share/bin/ )

Søren Holm (sgh) wrote :

Correction : The current version is actually build with python support. Python3 that is.

So the question is now why the debugginghelpers does not work ....

Petko Ditchev (pditchev) wrote :

It is still GDB-python related (Ubuntus GDB had problems with 'gdb python print 123' or something like that (I was prompted to try it out on the Qt-dev mailing list when discussing the problem) ).

Søren Holm (sgh) wrote :

This works :

(gdb) python print("123")
123
(gdb)

Whereas this does not

(gdb) python print 123
  File "<string>", line 1
    print 123
            ^
SyntaxError: invalid syntax
Error while executing Python code.
(gdb)

Petko Ditchev (pditchev) wrote :

Well , I tried the second one , and as you show it the error is apparently in my syntax . So I have no further clue . All I know is GDB in the repos needs to get updated/rebuilt.

Søren Holm (sgh) wrote :

Yes - the easiest fix is to compile gdb with python2-support instead of python3.

Søren Holm (sgh) wrote :

I have now tried compiling gdb with "--with-python=python2". Now it works - så I guess that whatever scripting qtcreator does to gdb must be ported to python3 - or gdb should be compiled agains python2 as it was in 13.04.

summary: - GDB is built without python support
+ GDB is not built with python2 support

The attachment "Patch for 7.6-5ubuntu2 to use python2 instead of python3" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Matthias Klose (doko) wrote :

the qtcreator bits should be ported to Python3 instead

Changed in qtcreator (Ubuntu):
importance: Undecided → High
status: New → Triaged
Changed in gdb (Ubuntu):
status: Confirmed → Invalid
Petko Ditchev (pditchev) wrote :

If the QtCreator adjustment isn't made in a reasonable time frame I don't think it's wise to just leave QtCreator debugging broken . I haven't tried it out but it's supposed to hurt the Ubuntu SDK too.

tags: added: saucy
Søren Holm (sgh) wrote :

I have retported the bug to the qtcreator-guys - including a couple of patches.

https://bugreports.qt-project.org/browse/QTCREATORBUG-10161

Matthias Klose (doko) wrote :

@sgh, please attach the patches here too, can't see them in the upstream issue

Søren Holm (sgh) wrote :

Some progress done in this case.

commit 7971b6e71405d50189b697bf071734a18102f1a4
Author: hjk <email address hidden>
Date: Wed Sep 11 21:35:39 2013

    Debugger: Make dumpers a bit more Python 3.x friendly

    Looks like Ubuntu 13.10 will ship GDB linked to Python 3.3.

    Change-Id: I748e8461531a3554d27ebfbf7af33385f69586c0
    Reviewed-by: hjk <email address hidden>

Søren Holm (sgh) wrote :

Commit 7971b6e71405d50189b697bf071734a18102f1a4 solves the issue. Only issue left is not that the commit is in qcreator master whoich is goin to be v3.0.0.

Matthias Klose (doko) wrote :

@sgh, are the two attached patches good enough?

Søren Holm (sgh) wrote :

Welll ... no. They certainly does not hurt, but the do not solve the issue either. I just submitted them to get some python3 compatability into qt-creator.

The actual patch that solved is this - unfortunately it does not seem easy to backport.

commit 7971b6e71405d50189b697bf071734a18102f1a4
Author: hjk <email address hidden>
Date: Wed Sep 11 21:35:39 2013

    Debugger: Make dumpers a bit more Python 3.x friendly

    Looks like Ubuntu 13.10 will ship GDB linked to Python 3.3.

    Change-Id: I748e8461531a3554d27ebfbf7af33385f69586c0
    Reviewed-by: hjk <email address hidden>

Søren Holm (sgh) wrote :

As of today a QT Creator 3.0 release branch has been created. A possible fix for this would be to package QT Creator 3.0...

Søren Holm (sgh) wrote :

Hi

I've been using qt-creato of the 3.0 branch since last update on this bug. And since 13.10 is now out I think it is problematic that it shipped with a QT Creator without proper debugging abilities. Developers upgrading to 13.10 will be disappointed.

So I wonder if it would be a problem release-vice to start to ship snapshots of the QT Creator 3.0 branch. I can provide limited testing as I use QT Creator profeessionally every day.

JJ (bjustjones) wrote :

I found this bug report thanks to this webpage documenting the issue:
http://hostilefork.com/2013/10/20/qtcreator-debugger-no-locals-ubuntu/

I suggest that bug # 1233662 is better titled and this bug should be marked a duplicate of it.
I'll go ahead and do so if I am able.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers