3

I am building an application which dynamically loads shared-libraries plugins with qtcreator on linux.

The plugin is built in a separate folder, then copied to the main application plugin folder. The application looks for plugins at startup and loads them.

Both plugin and executable are built in separate CMake projects (in Debug configuration), which are loaded in my qtcreator session.

It seems that the debugger is unable to link the library with the source code files. This has two effects * The breakpoints I put on the plugins files are ignored * If I put a "code breakpoint" (i.e. asm int 3) in the plugin code, the debugger shows me the dissasembly (and not the source).

How can I tell the debugger to look for the right source files ?

Louen
  • 3,617
  • 1
  • 29
  • 49
  • I don't think you can do what you expect (having "breakpoints" in library source file being hit by your pre-compiled library). If you want to debug the library you should run the library project - maybe write some unit-test with qt ? Otherwise you could add some verbose/print to your library sources... – floppy12 Feb 18 '16 at 22:10
  • Possible duplicate: https://stackoverflow.com/questions/20343949/how-to-set-a-breakpoint-in-a-shared-library-opened-with-dlopen-in-qtcreator-in-l – jpo38 Oct 12 '21 at 08:20

1 Answers1

1

You may set breakpoints in libraries, based on function names and such. To view source code of break points the library must be compiled with debugging symbols (e.g. qmake CONFIG+=debug), and the source code cannot be moved after it is compiled. I believe breaking on file and line numbers also requires the source. If you are still experiencing problems I would try adding the source directory to INCLUDEPATH, or loading both projects in QtCreator at runtime.

Funmungus
  • 134
  • 1
  • 4