Setting up lldb debugger in qt 5-4 on macos-x darwin-kernel-version-14-3-0
-
I have installed Qt 5.4 on MacOSX Darwin Kernel Version 14.3.0 and am trying to setup LLDB Debugger as GDB has been depurated from MacOSX (as i didn't found it as default).
When i am trying to setting up debugger option in Build & Run kit in Qt Creator following below steps mentioned in Qt Documentation :
Select Tools > Options > Build & Run > Kits.
Select an automatically created kit in the list, and then select Clone to create a copy of the kit.
In the Debugger field, select an LLDB Engine. If an LLDB Engine is not listed, select Manage to add it in Tools > Options > Build & Run > Debuggers.
For more information, see Adding Debuggers. To use the debugger, add the kit in the Build Settings of the project.I am setting the Debugger as "/usr/bin/lldb" in the Build&Run Kit. After following all the steps correctly as mentioned various forums when i try to set the breakpoint and run the Qt project in Debug mode it is not hitting the breakpoint.It running as "Run" option Not working like "DEBUG" Mode.
I have one small question or maybe asking for suggestion regarding following error which i resolved but i don't know whether its correct way to do that.
When trying to run an executable I've been sent in Mac OS X, I get the following error
dyld: Library not loaded: libLocalIPC.1.dylib
Referenced from: /Users/"Directory my executable is in"
Reason: image not found. I fixed this issue with setting Environment DYLD_LIBRARY_PATH under Project Settings/Run Environment with the library path which points to debut version of library.So for Building my Application in Release i have to again set the Library Path with Release Library Path.So this solution is not correct.
Another Solution i tried before that was with using otool -L @executable_Path/XXX.exe and checking the path of dylib and changing it with,install_name tool of Xcode but it didn't worked also.
Example: MacOS xxx$ otool -L check abc
libLocalIPC.1.dylib (compatibility version 1.0.0, current version 1.0.0)
libxxx.1.dylib (compatibility version 1.0.0, current version 1.0.0)
libqyyy.1.dylib (compatibility version 1.0.0, current version 1.0.0)
libzzz.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/Users/spandey/Qt/5.4/clang_64/lib/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets (compatibility version 5.4.0, current version 5.4.1)
/Users/spandey/Qt/5.4/clang_64/lib/QtWebEngine.framework/Versions/5/QtWebEngine (compatibility version 5.4.0, current version 5.4.1)
/Users/spandey/Qt/5.4/clang_64/lib/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.4.0, current version 5.4.1)
/Users/spandey/Qt/5.4/clang_64/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.4.0, current version 5.4.1)
After this i set the path to libs libxxx.1.dylib,libyyy.1.dylib & libzzz.1.dylib and again run the otool -L abcResults :Administrators-Mac-Pro:MacOS spandey$ otool -L abc
abc: /Users/spandey/Desktop/Perforce/launcher/xxx/libxxx.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/Users/spandey/Desktop/Perforce/launcher/ThirdParty/yyy/lib_osx/libqyyy.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/Users/spandey/Desktop/Perforce/launcher/ThirdParty/zzz/debug_osx/libzzz.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/Users/spandey/Qt/5.4/clang_64/lib/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets (compatibility version 5.4.0, current version 5.4.1
MacOS xxx$ ./abc dyld: Library not loaded: libzzz.1.dylib Referenced from: /Users/spandey/Desktop/Perforce/launcher/xxx/libxxx.1.dylib Reason: image not found Trace/BPT trap: 5Please can some one help me in both the issues as i am trying this from last 3 days with no success.
-
Hi and welcome to devnet,
Before starting an application outside Qt Creator, you should run macdeployqt who should copy the necessary libraries in the bundle as well correct the paths to make it self contained.
Which version of Xcode do you have installed ?
-
Thanks for replying to my Questions.
Sorry for replying so late.
Also regarding my question of using lldb as debugger it is not hitting the break point which i had set in QtCreator project.Now i tried installing gdb debugger it works,But for Non-Qt Project it fails to load the debugging symbols.
But using LLDB debugger issue is still persists.Second Question of resolving the issue of Library not loaded by executable.
I tried using :
otool -L ABC.exeand it showed me the dependent .dylib and there path where missing But i tried changing it via
install_name_tool -change <old> <new> <exe>
But i got same error.Then i set the DYLD_LIBRARY_PATH inside my Qt Project under Project > Run>Run Environment >
I hardcoded the path for Debug external Libraries.But how it work for Release external Library.
I need to again amend that for Release Build ?
I am currently using Xcode 6.3.