PDA

View Full Version : Maya Plugin Debugging basics


PushT
08-01-2012, 12:01 AM
Hi:-)
Pretty new to debugging plugins. I am debugging a maya plugin from way back 2004. I know it is working, because I have compiled and used it. The point is that I want to analyze it. I have loaded the plugin in Maya and attached maya.exe in the visual studio debugging environment. I am loading symbols from the Microsoft Symbol servers. What I am not quite sure about are all the output statements I get when I attach.....

‘maya.exe’: Loaded ‘C:\Program Files (x86)\Autodesk\Maya2010\bin\maya.exe’, Cannot find or open the PDB file
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\ntdll.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\kernel32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Program Files (x86)\Autodesk\Maya2010\bin\AppVersion.dll’, Cannot find or open the PDB file
‘maya.exe’: Loaded ‘C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcr90.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Program Files (x86)\Autodesk\Maya2010\bin\Foundation.dll’, Cannot find or open the PDB file
‘maya.exe’: Loaded ‘C:\Program Files (x86)\Autodesk\Maya2010\bin\MayaRes.dll’, Cannot find or open the PDB file
‘maya.exe’: Loaded ‘C:\Windows\winsxs\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.30729.6161_none_4bf7e3e2bf9ada4c\mfc90.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\user32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\gdi32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\advapi32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\rpcrt4.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\secur32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\shlwapi.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\msvcrt.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.6002.18305_none_88f3a38569c2c436\comctl32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\msimg32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\oleaut32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\ole32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Program Files (x86)\Autodesk\Maya2010\bin\Base.dll’, Cannot find or open the PDB file
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\wsock32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\ws2_32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\nsi.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcp90.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Program Files (x86)\Autodesk\Maya2010\bin\adlmint.dll’, Cannot find or open the PDB file
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\comdlg32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\shell32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\netapi32.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\psapi.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Program Files (x86)\Autodesk\Maya2010\bin\MC3.dll’, Cannot find or open the PDB file
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\winmm.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\oleacc.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\winsxs\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.30729.6161_none_4bf7e3e2bf9ada4c\mfc90u.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\IPHLPAPI.DLL’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\dhcpcsvc.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\dnsapi.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\winnsi.dll’, Symbols loaded (source information stripped).

......... It goes on like that, then finishes: ‘maya.exe’: Loaded ‘C:\Users\eivindt\Documents\Visual Studio 2010\Projects\testMaya\Debug\TestMaya.mll’, Symbols loaded.
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\msvcp100.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\msvcr100.dll’, Symbols loaded (source information stripped).
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\mfc100.dll’, Symbols loaded.
‘maya.exe’: Loaded ‘C:\Windows\SysWOW64\mfc100enu.dll’, Binary was not built with debug information.
The thread ‘Win32 Thread’ (0x1a64) has exited with code 0 (0x0).
The thread ‘Win32 Thread’ (0x18c4) has exited with code 0 (0x0).
The thread ‘Win32 Thread’ (0x14f8) has exited with code 0 (0x0).
The thread ‘Win32 Thread’ (0x1914) has exited with code 0 (0x0).

Is this normal behaviour, or is there something wrong here ? I can see that the PDB(s) is/are not being found or loaded for all the Maya dll’s but is that the way it is supposed to be ?
When I run the plugin I get a lot of these:
First-chance exception at 0x7710c83b (kernel32.dll) in maya.exe: Microsoft C++ exception: FNPNS::TSM::CDoesNotExistException at memory location 0x0162f334..
First-chance exception at 0x7710c83b (kernel32.dll) in maya.exe: Microsoft C++ exception: FNPNS::TSM::CDoesNotExistException at memory location 0x0162f334..
First-chance exception at 0x7710c83b (kernel32.dll) in maya.exe: Microsoft C++ exception: FNPNS::TSM::CDoesNotExistException at memory location 0x0162f334..

Can someone please enlighten me.....?

zoharl
08-02-2012, 08:30 AM
Funny...

Add

MAYA_DEBUG_NO_SIGNAL_HANDLERS=1

to your c:\Users\zohar\Documents\maya\2013-x64\Maya.env

attach debugger to maya, and from VS debug> exceptions enable everything you need (probably nothing, but if VS doesn't break on exception then try to enable everything).

VS must break on exception, and your call stuck window should show the exact faulty line in the code. Remember to build your plugin in debug, when debugging, and add debug info (.pdb file) to your release version as well.

PushT
08-11-2012, 02:29 AM
Thank you for the answer. I did as you instructed. There is an exception thrown every time I execute some action in Maya, I am guessing that is normal. When I run the plugin though, there is nothing...... Is this normal ?? I have no clue. Of course my script editor spews out MEL commands, and the plugin works , but surely if visual studio must break on exception then I should be seeing them when I run the plugin, or does my not seeing them mean they are just handled ?

PushT
08-11-2012, 02:54 AM
I have tried to set break points in the different source files. In all the external dependency files I get the "the breakpoint will not currently be hit. No executable code is associated with this line. possible causes include: preprocessor directives or compiler/linker optimizations " I know these lines are hit, but I am not surprised as the output window for my debug build clearly states that no pdb files were found for the maya files.

PushT
08-11-2012, 02:58 AM
Just to make it clear, the breakpoints that are not hit are Maya headers...... Which means I am maybe answering my own question ?

zoharl
08-11-2012, 07:27 AM
Right:

http://forums.cgsociety.org/showthread.php?t=1057556

BTW, if you have only maya headers (naturally...), and they don't contain template code, i.e. there are only definitions and no execution code, then where exactly did you try to put a break point?

PushT
08-11-2012, 11:14 PM
Sorry, I was a little out of it there for a while..... Hehe
No, everything ok. I get it :-) Thanks!

PushT
08-12-2012, 01:12 AM
I can't seem to find these either.... I saw that you were looking for them...

CGTalk Moderation
08-12-2012, 01:12 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.