How to debug a plugin?

2be105711208a7204e97808e14ba2672
0
celu 101 Feb 19, 2007 at 16:36

Hi I have been developing a plugin for maya.I want to know how to debug my plugin? When i start the debugger it asks me for a target application.I tried setting the target application as maya,But I get the following error.
“Debugging information for ‘maya.exe’ cannot be found or does not match.No symbols loaded.”
I feel lost.It would be really gr8 if someone could point out the correct way to setup the debugger so that I could step through my plugin, just as i would for a normal application.

thx.

celu

7 Replies

Please log in or register to post a reply.

64212d89ffc7e91ed54b96ebbe99bd05
0
hovermonkey 101 Feb 19, 2007 at 16:51

Ignore the warning and stick a breakpoint at the entry point of your plugin DLL; it should still stop at the breakpoint once the program loads and starts it. Obviously make sure your DLL is compiled and linked with the right debug information etc.

46407cc1bdfbd2db4f6e8876d74f990a
0
Kenneth_Gorking 101 Feb 19, 2007 at 21:43

It will stop at the breakpoint, I used to debug plugins for 3dsmax that way. It worked fine, except for all the debug info it spit out, it slowed it down a bit.

2be105711208a7204e97808e14ba2672
0
celu 101 Feb 20, 2007 at 03:02

When I set a break point, and start the debugger in my visual studio, the ‘maya.exe’ is automatically started.But once maya loads I get the following error message.
“Windows has trigered a break point in maya.exe. This may be due to a currption of the heap and indicates a bug in maya.exe or any of the DLLs it has loaded.”

Im relativley new to working with plugins.So im pretty clueless as to wats causing this problem.Once I setup the debugger properly,I would be able to pick it up from there.

I will list out wat i did so far.So you can guide me better.

1)I have compiled and built my foo.mll maya plugin.
(my plugin is a simple command plugin that displays the CVs of the selected object on the maya output window)

2)I copied my plugin into the plugins folder of maya.
(I tested my plugin in maya and its working fine.)

3)Now when I try to run my plugin code in debugging mode(F5),I get the following warning,

“Debugging information for ‘maya.exe’ cannot be found or does not match.No symbols loaded.”

when i give continue.the debugger starts ‘maya.exe’ but as soon as maya loads,I get the following error message.

“Windows has trigered a break point in maya.exe. This may be due to a currption of the heap and indicates a bug in maya.exe or any of the DLLs it has loaded.”

(This is irrespective of Whether or not I have a break point set in my plugin code or not)

any pointers as to what might be going wrong or about how to find out wats going wrong would be really helpful.

thx.

46407cc1bdfbd2db4f6e8876d74f990a
0
Kenneth_Gorking 101 Feb 20, 2007 at 10:05

Have you tried to just continue execution (F5 again)? If maya can start without a debugger attached, I’m sure it can start with one attached. :)
Otherwise if you can see what dll is the culprit, then try and disable it (if it is just a plugin). When I was debugging for 3dsmax I got some exceptions from one the dlls, but I was able to continue without problems.

6d318bb67270aa12b325e2cd7b64ff7a
0
pater 101 Feb 20, 2007 at 21:20

@Kenneth Gorking

If maya can start without a debugger attached, I’m sure it can start with one attached. :)

That is not always true. Some programs use methods to prevent debugging (the simplest one is to use IsDebuggerPresent() of the Windows API).
There are even programs (i.e. Google Desktop with the Sidebar(!)) which are really intended for plugins, that use such methods, which makes it quite hard to develop a plugin.

99f6aeec9715bb034bba93ba2a7eb360
0
Nick 102 Feb 20, 2007 at 22:33

Start Maya, then go to ‘Debug > Attach to Process’, and select Maya. This way you can skip much of the exceptions and debug checking stuff at the startup. Also in ‘Debug > Exceptions’ you can select what exceptions you want to break on.

2be105711208a7204e97808e14ba2672
0
celu 101 Feb 21, 2007 at 08:24

thx guys now its working i started maya,loaded my plugin and then used attach to process in visual studio and its working! thx!