[SOLVED] Debugging a plugin?
I have the following setup and debugger doesn't stop at my Qt plugin class breakpoint.
- MSVC 2010 with SDK 7.1, both in SP1 version
- Qt 4.8.5 64 bit
- x64 compiler
- following debugger:
** name: "auto-detected CDB at c:\program files\debugging tools for windows (x64)\cdb.exe"
** there is a clickable link that states: "specify the path to the windows console debugger executable (64-bit version) here."
** path: c:\program files\debugging tools for windows (x64)\cdb.exe
** ABIs: x86-windows-msvc2010-pe-64bit
- I use a library which added an interface to a standard Qt plugin. I implemented a class based on this interface.
- I compile this library in debug mode.
- I click on debugger icon and chose launcher.exe as startup program. This executable is the startup program of a project I was given and that hosts plugins. I will refer to it below as "hosting project". It's compiled in RelWithDebInfo mode. I have dlls and pdbs.
- do I need to get a debug mode compiled version of hosting project?
- I assume host project looks for plugins in its bin directory, so will my breakpoint work when I don't adjust source path ("mapping source paths" link below)?
What's the proper way of debugging plugins?
For now I didn't follow these instructions: http://qt-project.org/doc/qtcreator-2.8/creator-debugger-engines.html#mapping-source-paths
From what I can see in "my log window":https://gist.github.com/postb99/f7d12d018cfdc09ec7f5 it seems I have to do it (warning : gist content updated according to second post below, mapping paths set now (can't link to a priori gist revision...). In addition I should have put my up-to-date dll in bin folder, right? Or else I would have older executable than source for my plugin.
So what's the best way?
I configured mapping source path.
Source path: C:\IMAGX-core\bin\applet-tutorial1.dll
Target path: C:\QtApps\applet-tutorial1, this is where my .h and .cpp reside.
@ *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\IMAGX-core\bin\applet-tutorial1.dll -
f5640000 000007fef564b000 C:\IMAGX-core\bin\applet-tutorial1.dll@
Might be a silly question but are you sure your plugin is build in debug mode ? Do you also have the according pdb file ?
Has for you the search path of your host program, it depends on what plugin you implemented. Is it a Qt extension ? A custom plugin ?
If the former, should be placed in the appropriate plugins subfolder. For the later it depends on your code.
In any case to test/validate a plugin, you should have a dedicated test application or unit test so you have full control over the plug in related aspects.
Hope it helps
The team which provided the plugins host told me that they should give me a debug build of their code so that I can debug my plugin within it.
I didn't see a .pdb generated in my plugin project debug build folder, I may be missing something?
I need to look further at code but the plugin is just a subclass of a standard Qt plugin (http://qt-project.org/wiki/QtPlugins). But the plugin host looks in a specific directory, so it looks a bit like a custom plugin implementation.
Thank, your answer helped too.
You're welcome !
You also need to ensure that you are all using the same Qt version