4

I am trying to debug with QTCreator my shared library which is being called with dlopen and dlsym. QT debugger does not stop at breakpoints in the shared library.

When I run my app with with GDB it works correctly.

The SO has debugging symbols.

how can I get QTCreator to debug my app?

Thanks.

Update:

I created a gdb startup script with the full path to my project and it now works. Thing is, I don't want this script to run for every project using QT.

Is it possible to do this per project?

yaronkle
  • 133
  • 1
  • 9
  • 1
    I'm trying to solve this same exact problem. Could you share more details regarding your solution? Have you found the "proper" way of doing this? – UndeadKernel May 26 '14 at 13:40

1 Answers1

0

It looks like GDB is unable to locate your .so file. You should check this post to see if the shared library can be found in your solib-search-path. If it's not, you should extend the "Additional Startup Commands" field in Tools/Options/Debugger/GDB with something like:

set solib-search-path %{CurrentProject:BuildPath}/<relative path to the folder where the .so file was built>

In my situation, working under Android, I set set solib-search-path %{CurrentProject:BuildPath}/android-build/libs/armeabi-v7a and now breakpoints work if set in shared libraries code.

@ChrisF: Tried to mark Debugging a dynamically-loaded library in c++ with QtCreator as being a duplicate of this question, but I must wait to have an upvote (stackoverflow won't let me flag the duplicate because "This question does not have an upvoted or accepted answer"..."

jpo38
  • 20,821
  • 10
  • 70
  • 151