[OpendTect_Developers] Debbugging Plugins from Visual Studio

Ranojay Sen ranojay.sen at dgbes.com
Tue Oct 5 09:46:24 CEST 2010


Dear All,

This post is about debugging your own plugin by using the Visual Studio 
debugger from the Visual Studio development environment. As some of you 
are already developing plugins with this environment, so this might help 
better understand the debug process.
First you have to download the developer package which already has the 
debug builds ready for OpendTect solution, now you have to build your 
plugin with the debug configuration, then you can follow the step by 
step methods for debugging the plugin code.
As the plugin's binaries are DLL's and not executables (.exe) so they 
cannot run directly, for this you have to use an executable file which 
will actually 'run', thus allowing you to have an entry point to the 
plugin binaries. Now follow these steps.

1) Select the project you want to debug,

2) Right-click and select “Set as start-up project” option from the 
pop-up menu. Once you do this the project name in the solution explorer 
becomes bold, indicating that the project has been changed to a start-up 
project, which means, this project will start to run when you press the 
debug button.

As mentioned earlier the plugin DLL cannot run on its own, so the moment 
you press the debug button you will get a dialog box to select the 
“executable file” which will actually run. In this dialog box provide 
the full path of the debug version of the odmain.exe file, i.e. 
$(WORK)\msvc\Win32\debug\odmain.exe, press OK to launch OpendTect. (The 
executable name can also be set in a different way, where you have to 
select the “Debugging” option in the project properties and set the 
“Command” option as the full path of the executable). Once OD pops-up 
you will see none of the plugins are loaded , as it is running from 
msvc\debug folder where it cannot find the alo files. Please note, at 
this point it is only the odmain.exe which is running and your plugin is 
still not loaded,

3) Now manually load your own plugin from the utilities->plugins->load 
plugins menu in OD, browse to your solution's debug folder where the 
debug version of your binaries are built. If everything is fine at this 
point you will see the plugin loaded. If you put a breakpoint in your 
code it will become active at this point which means it is now possible 
to debug the code. Follow the standard stepping operations to go in and 
out of the code as usual.

Have a look at the presentation file attached with this email. where I 
have taken the screen shots of the procedure sequentially.

Please come back to me if you have any questions.

Regards
Ranojay
-- 

Ranojay Sen
dGB Earth Sciences - India
304, Gateway Plaza
Hiranandani Gardens, Powai
Mumbai-400076
India
Phone: +91 22 25704984
Mobile: +91 9930834087

-------------- next part --------------
A non-text attachment was scrubbed...
Name: debugpi.ppt
Type: application/vnd.ms-powerpoint
Size: 1097728 bytes
Desc: not available
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20101005/39cab249/attachment.ppt>


More information about the Developers mailing list