0
votes

This is sort of a followup to this thread--unfortunately I didn't make any progress at the time so I thought I would start over. I am consistently getting this in the debugging log (QtCreator 2.3.1, Qt 4.7.3, gdb 7.2):

A syntax error in expression, near 0'.\n" 295^error,msg="A syntax error in expression, near0'." &"Python scripting is not supported in this copy of GDB.\n" 296^error,msg="Python scripting is not supported in this copy of GDB." &"Python scripting is not supported in this copy of GDB.\n" 297^error,msg="Python scripting is not supported in this copy of GDB." &"Python scripting is not supported in this copy of GDB.\n" 298^error,msg="Python scripting is not supported in this copy of GDB." &"Undefined command: \"bbsetup\". Try \"help\".\n" 299^error,msg="Undefined command: \"bbsetup\". Try \"help\"." dThe debugging helper library was not found at . &"source /home/matt/QtSDK-4.7.3/pythongdb/gdb\n" &"/home/matt/QtSDK-4.7.3/pythongdb/gdb:1: Error in sourced command file:\n" &"Undefined command: \"\". Try \"help\".\n" 300^error,msg="/home/matt/QtSDK-4.7.3/pythongdb/gdb:1: Error in sourced command file:\nUndefined command: \"\". Try \"help\"." &"Undefined command: \"bbsetup\". Try \"help\".\n" 301^error,msg="Undefined command: \"bbsetup\". Try \"help\"." dThe debugging helper library was not found at . 302^done <303set substitute-path /var/tmp/qt-src /usr/include

The specific problem is that without the debugging helper, I'm unable to see the contents of QStrings and many other data structures during the debugging process, which makes it much more time-consuming. The error messages above are symptomatic, the problem arises when gdb can't find the debugging helper.

Anyway, looking at the discussion referenced in the answer in the above thread, I hunted around for different versions of gdb on my system but each one of them produced the same error (with the path changed appropriately of course), including version 7.3.1 when I downloaded it. I've also located libDebuggingHelper.so, but sticking it in different places hasn't helped either. Lastly looking at ./configure --help for gdb, I didn't see any options for enabling/disabling python in the build. Anybody know how I can get this to work?

3

3 Answers

2
votes

This site claims you need to configure GDB using

./configure --with-python
1
votes

It's pretty clear from the error message that the GDB you built does not have python support compiled in.

In gdb/config.log look for messages like checking whether to use python and see why GDB decided to not use Python on your system.

Perhaps you need to install Python development packages?

Once you've configured GDB to use Python, an easy way to check whether Python support is properly compiled in is:

(gdb) python print "hello"

If that prints anything other than hello, you are still not where you want to be.

0
votes

I solved the problem with

sudo apt-get install gdb-multiarch

Thanks to @Employed-Russian for allowing me to check if GDB indeed has python support.

I did have to use the syntax

(gdb) python print("Hello")

To get a proper response from python within GDB.