Jump to content


How to debug a plugin?


7 replies to this topic

#1 celu

    New Member

  • Members
  • PipPip
  • 20 posts

Posted 19 February 2007 - 04:36 PM

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

#2 hovermonkey

    Member

  • Members
  • PipPip
  • 38 posts

Posted 19 February 2007 - 04:51 PM

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.

#3 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 911 posts

Posted 19 February 2007 - 09:43 PM

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.
"Stupid bug! You go squish now!!" - Homer Simpson

#4 celu

    New Member

  • Members
  • PipPip
  • 20 posts

Posted 20 February 2007 - 03:02 AM

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.

#5 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 911 posts

Posted 20 February 2007 - 10:05 AM

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.
"Stupid bug! You go squish now!!" - Homer Simpson

#6 pater

    Valued Member

  • Members
  • PipPipPip
  • 117 posts

Posted 20 February 2007 - 09:20 PM

Kenneth Gorking said:

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.

#7 Nick

    Senior Member

  • Members
  • PipPipPipPip
  • 1225 posts

Posted 20 February 2007 - 10:33 PM

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.

#8 celu

    New Member

  • Members
  • PipPip
  • 20 posts

Posted 21 February 2007 - 08:24 AM

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users