PDA

View Full Version : Howto debug a custom plugin?


reedev
04-10-2009, 04:31 AM
Hi,

I have trouble getting my plugin to work and I would like to debug it somehow. I realize that the plugin package that one can download only contains the release libs but maybe you have other ways to debug as well. All the info I get now is "winviz.exe has stopped working". I am on Vista.

Also, my classes are working nicely when I use my own-built osg 1.2, both debug and release mode. The plugin is only a very thin wrapper around these classes so essentially I use very little plugin specific code.

Thanks in advance for any pointers/tips!

regards
Raymond

Gladsomebeast
04-14-2009, 03:09 PM
You can build a debug plugin.

Setup your debug build just like the release build. I seem to remember needing to make a copy of python24.lib and renaming it python24_d.lib because of a statement in python.h.

Now when you get the crash message, click the debug button. Check the call stack for your plugin code if you crash in some other .dll's machine code.

reedev
04-23-2009, 02:59 PM
Hi,
That's interesting! Would that mean that I can attach my VS to a running vizard? I'll try when I have time...

regards
Raymond

Gladsomebeast
04-23-2009, 03:16 PM
Its been a while, but I remember setting break points and stepping through plugin code. Don't remember how I did that though.

You can try setting up the 'Debugging' project properties to run the winviz.exe with a test script as an argument. The test script should load and use your plugin of course.