Menu

PluginDebugging

Jens-Malte Gottfried

How to debug charon plugins

Here you find useful hints of plugin debugging techniques.

Assume, you have created some new plugins and have some (e.g. CMake-) project to build them.

'''First of all''' please make sure, that the DLLs you want to debug only exist '''once''' on your hard drive so that you cannot accidentially debug an older version!
(For example, the charon-core.dll is located in the build-directory of tuchulcha and in the installed version of tuchulcha. Depending on how you debug the plugin, you have to take care of that.)

Visual Studio

  • build your plugins in debug mode
  • do not copy or install them to the global plugin path, leave them
    where they have been just created
  • set Tuchulcha's private plugin path (in Tuchulchas option dialog)
    to the directory where your new plugin dlls are located
  • run Tuchulcha and run "update plugins" from the File-Menu,
    your new plugin should show up in the selector widget, if not,
    there are perhaps some .dlls missing, you should copy them from the global
    plugin path to your private one.
    The [http://www.dependencywalker.com/ Dependency Walker] may help
    to locate missing dlls.
    In the update summary which shows up after running "update plugins", tuchulcha
    displays the location of the plugin files beeing loaded. Double check if the path
    of the module to be debugged is that in your build directory.
  • attatch the MSVC debugger to the running Tuchulcha session
    (using remote debugging). You need the MSVC Professional Edition
    to do this, the Express Edition does not offer this kind of debugging.
  • set breakpoints in your plugin code
  • set up some workflow in Tuchulcha to test your plugin
  • run "execute workflow" in Tuchulcha
  • the Plugin execution should stop now at your breakpoints,
    continue debugging as ususal

Related

Wiki: DeveloperBeginnerGuide