Unable to debug application in Qt Creator 3.1.2 (Qt 5.3.1) on MacOS X
-
Hello!
I have a problem running debugger... And can't even find any idea how to fix it... I only have next messages:
In Qt Creator's Application output:
Debugging starts
Debugging has failed
Debugging has finishedAnd in console (if I run it from console):
~/Qt/Qt\ Creator.app/Contents/MacOS/Qt\ Creator
Unexpected GDB stderr: "Undefined command: "python". Try "help".
Undefined command: "python". Try "help".
Undefined command: "python". Try "help".
"
Warning: HANDLE RUNCONTROL START FAILED (no active run control)
Warning: State changed from EngineSetupFailed(2) to DebuggerFinished(23) [master] (no active run control)
Warning: State changed from EngineSetupFailed(2) to DebuggerFinished(23) (no active run control)
Warning: (gdb) (no active run control)
Warning: UNEXPECTED GDB STDERR: No symbol table is loaded. Use the "file" command.
(no active run control)
Unexpected GDB stderr: "No symbol table is loaded. Use the "file" command.
"
Warning: 14^error,msg="No symbol table is loaded. Use the \"file" command." (no active run control)
Warning: (gdb) (no active run control)What I can check find the problem and to fix it?
-
Hi,
There's something pretty fishy here, python is unknown ?
-
No, python is here! I don't understand why Qt and GDB need python, but I can run it from anywhere:
$ python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.^D
$ -
Qt doesn't however gdb uses python for e.g. pretty printing. Anyway, did you build the debugging helpers ?
-
No, I didn't because I can't find where to do it in Qt Creator 3.1.2.
-
Hello!
This really doesn't work:
@gdb
GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb 6 22:51:23 UTC 2013)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
(gdb) python print("Hello, world!)
Undefined command: "python". Try "help".
(gdb)
@But earlier (in previous versions of Qt) debugging worked... I think I upgraded Xcode (and gdb) since that too... Do you think I have to find version of gdb with python working?
-
I looked for information about gdb and python in Qt debugging and found that:
MacOS gdb really doesn't support python as scripting language
That's why Qt Creator under MacOS need C++ debugging helpers
but in my QtCreator there is no button "Build all" or "Build debugging helpers" as in previous versions... Only common information about Qt, path, etc.
Is there any way to build C++ debugger helpers from console?
Why it still doesn't work if a turn debugging helpers off (if I understand well - helpers are used for pretty printing variables).
I'm quite sure that I have latest MacOS development tools installed (not betas, but latest stable).
-
Thanks to everybody for very helpful information, I've created custom Qt configuration using lldb instead of gdb (by default automatic Qt configuration uses gdb and doesn't allow to change it) and debugging started to work!
-
just ran into the same issue. The work around helped me as well. Filed a bug report https://bugreports.qt-project.org/browse/QTCREATORBUG-12791
-
Xcode 6 brought some modification in the way to handle lldb but it should be fixed in Qt Creator 3.2.
If you can't upgrade you can find the solution to apply in the "LLDB hangs while being launched on Mac OS X" thread on the interest mailing list
-
Hi,
I'm experiencing something similar since I upgraded to Yosemite (10.10). I can run the debugger, but it never stops at breakpoints.
The app is correctly run via lldb (if there is a crash or an assertion failed, the debug shows up and I can browse the call stack), but breakpoints are not correctly set.running lldb manually on the same executable, setting there breakpoint works as expected.
I'm trying today's snapshot without success.
In console, I can see the following when I set a breakpoint, when a debug session has been started:
SOFT ASSERT: "false" in file /work/build/qtsdk/qt-creator/src/plugins/debugger/lldb/lldbengine.cpp, line 684
SOFT ASSERT: "false" in file /work/build/qtsdk/qt-creator/src/plugins/debugger/lldb/lldbengine.cpp, line 619
UNEXPECTED STATE 5 FOR BP 7will investigate by looking at the source code, but was just wondering if someone already has the issue.
-
IIRC, there was also a modification to how lldv should be initialized (can't remember the details though)
Which version of Qt Creator are you using ?
-
I finally got it working:
- I was using launchd.conf to set environment variables, which is not working with Yosemite (see http://stackoverflow.com/questions/25385934/setting-environment-variables-via-launchd-conf-no-longer-works-in-os-x-yosemite). I changed that so all my path, CC and other variables are taken into account
- I'm using ccache, I cleared the cache and rebuilt everything.
Not sure if the launchd change or clearing ccache did the trick, but now it works - thanks.