Help - how to profile DLL files with arbitrary entry points (lcc-win32 v3.8)

  • Follow


I managed to compile a Matlab DLL from the command prompt succesfully
on Windows Vista for profiling. I compiled the __profile.asm file
prior to calling lcclnk.

Now I believe the lcc-generated profiling function
__profile_write_my_engine() did not get triggered when I invoke my DLL
file from Matlab. Everything worked, except that there is no profiler
output.

The entry point for my Matlab DLL is mexFunction(). But if I specify
this in lcclnk using the -entry option, my machine crashes if I
attempt to run invoke the DLL.

Many thanks in advance for your thoughts!


----------------------------------------------------------------------------
lcc and lcclnk logs
----------------------------------------------------------------------------
c:\> lcc My_Engine.c -FoMy_Engine.obj -g2 -profile -v -I"C:\Program
Files\MATLAB\R2007b\extern\include" -I"C:\lcc\include\" -
DMATLAB_MEX_FILE -DNDEBUG -DMX_COMPAT_32

Warning My_Engine.c: 52  assignment of pointer to array 2 of pointer
to incomplete struct mxArray_tag defined at c:\program files\matlab
\r2007b\extern\include\matrix.h 311 to pointer to pointer to
incomplete struct mxArray_tag defined at c:\program files\matlab\r2007b
\extern\include\matrix.h 311
Logiciels/Informatique lcc-win32 version 3.8. Compilation date: Dec 18
2007 19:12:54
Spills:0 Chars read: 222310, Assembly time: 0 ms, Memory used:
1245184,Time = 0.032 sec.
0 errors, 1 warning
.............................................................................
c:\> lcc "C:\Program Files\MATLAB\R2007b\sys\lcc\mex\lccstub.c" -
FoMy_Engine.TempLib.obj -g2 -profile -v -I"C:\Program Files\MATLAB
\R2007b\extern\include" -I"C:\lcc\include\" -DMATLAB_MEX_FILE -DNDEBUG
-DMX_COMPAT_32

Logiciels/Informatique lcc-win32 version 3.8. Compilation date: Dec 18
2007 19:12:54
Spills:0 Chars read: 659088, Assembly time: 0 ms, Memory used:
2555904,Time = 0.043 sec.
.............................................................................
lcclnk -o My_Engine.mexw32 -Dll "C:\Program Files\MATLAB\R2007b\extern
\lib\win32\lcc\mexFunction.def" -L"C:\Program Files\MATLAB\R2007b
\extern\lib\win32\lcc" My_Engine.TempLib.obj My_Engine.obj profile.lib
__profile.obj libmx.lib libmex.lib libmat.lib
Writing library for My_Engine.mexw32
0
Reply MatlabMonkey 1/11/2008 5:56:50 PM


0 Replies
110 Views

(page loaded in 0.043 seconds)

5/24/2013 12:48:45 AM


Reply: