debugging mex file from VS 2008, must reopen MATLAB

  • Permalink
  • submit to reddit
  • Email
  • Follow


I have been building and debugging mex files in Visual Studio for many years.  For as long as I can remember, I was able to build my solution, attach to a MATLAB, and debug.  Then, if I needed to alter my mex dll, I could clear functions in MATLAB, update my dll code, rebuild, reattach to the same MATLAB process, and go on my merry way.

Recently, I have been unable to keep using the same MATLAB when debugging.  The MATLAB will pick up the changes to my mex dll, but it will no longer stop at VS breakpoints.  Instead, I must close MATLAB, open a new one, and attach my VS debug to that new MATLAB process.

Has anyone else seen this change in behavior?  Does anyone know what caused it or, even better, how to solve it?

Thanks
0
Reply Jeremy 12/6/2010 2:51:07 PM

See related articles to this posting

comp.soft-sys.matlab 202771 articles. 522 followers. Post

0 Replies
438 Views

Similar Articles

[PageSpeed] 2


Reply:

Similar Artilces:

How to debug (step run) a mex file(mexw32 or dll file) in MSVC / visual studio 2008 express edition
Please follow following steps 0.Creat your dll or mexw32 file using the option make -g or mex -g filename.c 1.Close every thing(to make it fast .. not mandatory though 2.Open MSVC 2008 Express Edition 3.Open Matlab 4.From MS VC 2008 Go To Tools->Attach To Process (If this option does n't show up repeat step 1 and it will :) 5.In Attach to process, select MATLAB.exe (Native code option is selected by default. If it is not select it manually) 6.From VC IDE, go to File->Open->File and select the file having mexFunction(testmex.c in my case) 7.Put Breakpoints ar required lines(it w...

Debug MATLAB Mex files using Eclipse
Hi, I am debugging MATLAB Mex files on Mac OS X. I am used to debugging them using VC++ on Windows. However, I am not very good with debugging using GDB. So I was wondering if there was any way of debugging MATLAB mex files on Mac using Eclipse C/C++ IDE. Thanks, Sandeep ...

Debug C MEX source file in Matlab?
Hi all, Can I debug C MEX source file directly in Matlab editor? Best regards, Davy Soho wrote: > Hi all, > > Can I debug C MEX source file directly in Matlab editor? > > Best regards, > Davy > short answer: you can't. long answer: you can start matlab by telling it what debugger to use (if you are on windows, from your ide, or in linux e.g. gdb). it then starts in the debugger. you can then set a breakpoint in your mex file and debug it as usual. however: it is a hassle, and i never got it really work on linux (the thing always crashed horribly). but you ...

How to debug matlab MEX-file using lcc-win32 debugger
Hi! I have written a matlab MEX file using C under Win XP. Now I want to debug it. I'd like to know if there's any way that I could debug it in lcc-win32? Now i only know the meathod to debug it in VC. Thank you very much! Coffee wrote: > Hi! I have written a matlab MEX file using C under Win XP. Now I want > to debug it. I'd like to know if there's any way that I could debug it > in lcc-win32? Now i only know the meathod to debug it in VC. > > Thank you very much! > Mathlab refuses to pay any maintenance for the compiler version they are using. I do not...

debugging mex files with solaris 8 and matlab 6.1
Does somebody know if latest versions allow mex files' debugging with dbmex? I've read on the help that sun solaris and matlab 6.1 are incompatible on debugging. Starting matlab with -Ddebugger or -Ddbx doesn't work... when I digit "run" I receive a SEGV... someone could help me? Thank you in advance, -- Matteo "I poeti sono come i bambini: quando siedono a una scrivania non toccano terra coi piedi" Stanislaw Lec ...

old MEX files Matlab 2008 and Ubuntu 8.10
Hi all, I'm facing the problem to get compiled an old MEX wrapper function that should interface Matlab with some C code. Such wrapper was done for Matlab 6 and works for Matlab 7 but now when I try to compile it with the Matlab 2008a I got some weird problems. If I use the command: mex ./src/myCfile.c -v -L ./bin Matlab will complain with: cmat.o: In function `checkstr': cmat.c:(.text+0x81): undefined reference to `mxGetString_700' cmat.o: In function `setDisparity': cmat.c:(.text+0xe1): undefined reference to `mxGetNumberOfDimensions_700' cmat.o: In function `setIma...

How do I debug a MATLAB 7.1 (R14SP3) MEX-file in Microsoft Visual Studio 6.0?
Hello, I followed the instrutions on http://www.mathworks.com/support/solutions/en/data/1-1Y1FEG/index.html?solution=1-1Y1FEG to debug my mex file in Microsoft Visual ++ 6.0 . After set the correct project setting in the new visual project and clicking on run in visual Matlab opens. However, I get the following error messages in Visual and if I call the mex function from Matlab it does not stop at the breakpoint that I have set in Visual. It just runs over it. Loaded symbols for 'C:\UserData\algomodel\Matlab\VE_MexKernel.mexw32' Loaded 'C:\Program Files\MATLAB\75_EL\...

Segmentation violation in mex file. How can we debug a mex file? I do not have unix.
Here is the mex code I wrote to read in a tab-delimited file. The mex file = got created but it causes my MATLAB to end abruptly and give the following = error. Can anyone help me where I am going wrong? Please let me know if any= further information is required Abnormal termination: Segmentation violation #include "mex.h" #include "matrix.h" #include <stdio.h> #include<string.h> #include<stdlib.h> =20 void mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[]) { =20 FILE *ptr_file; const char **field_names; ...

[mex] how debug a mex file with visual studio
Hello everybody I want to understand how to debug a mexfile with visualstudio. I made some research and I found a topic which explain how to do it. http://www.mathworks.com/access/help...89.html#f18756 I followed all the step, I compiled the ".c" with debug option : mex _g I attached the matlab process on visual studio then I run the file on matlab. the file work, i have the result on matlab, but it doesnt stop on the breakpoint putted on the file with visual studio. I am not able to get in the code. I don t understand why. someone got an idea? drevlalv Bonjour a to...

size of Matlab files vs. SAS files
I have about a million observations that I want to save into a dataset. Would the file be smaller if I saved it in Matlab or in SAS? For approximately 20 columns, how big would it be? Thanks for any help you can provide. Christine J wrote: > > I have about a million observations that I want to save into a > dataset. Would the file be smaller if I saved it in Matlab or in > SAS? For approximately 20 columns, how big would it be? Thanks for > any help you can provide. Depends on how you do the save operation. If you write it as a binary file, it will be (number_elements * elem...

Forcing Matlab to run .m file when a mex file is present
I am creating an environment to test mex files which will replace exisiting m files in an extensive matlab simulation. As I do this I want to be able to check that the results from the new mex function are the same as the result from the existing m file function. Is there a slick way to force Matlab to call the m file function when a mex function of the same name exists? Ideally I would want to do something like: a = my_function(x,y,z) % calls the mex version b = my_function(x,y,z) % calls the m file version error = abs(a-b); Any suggestions that don't require renaming files? Thanks a l...

Differences in XML File generated in Matlab vs Outside Matlab
Hi, I have a java class, which generates the XML file. I am using the same class in both Matlab session and in Eclipse. Following is the code I am using to genate the XML file public static void saveDocument(Document doc, File file) throws Exception { DOMSource source = new DOMSource(doc); OutputStream stream = new FileOutputStream(file); StreamResult result = new StreamResult(stream); Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOu...

How to call or pass MATLAB file pointer in C Mex file?
Hello all, 1. I am trying to read large binary data files (~1 GB size), process the information and dump the outputs (which are also of incredibly big size) to MATLAB workspace. I wrote a mex file to do the same (so that I have faster program execution speeds). 2. The C mex file that I wrote works very well and can dump all the variables to MATLAB workspace for smaller size files. However for larger binary files, the MATLAB gives OUT OF MEMORY error as the size of the variable space is simply too big. 3. Often I am not interested in all portions of the file and don't need all the variab...

how to debug mexed c-file without corresponding m-file?
Hi, everyone: I downlaod some mex-ed c-files and want to make modification for my problem. However, I don't have the origianl corresponding m-files. So the debugging method introduced in matlab help document doesn't work and can't transfer the data and debugging progress to MS Visual C 2005. Is there any method that can achieve the debugging without original m-files? Thanks a lot! ...

MATLAB crashing with MEX file in function working well outside of MATLAB
Hi Everyone, I have an high level problem (I believe) that I will try to explain; My development platform is: 64bit Ubuntu 12.04 LTS and MATLAB 2013b with GCC/G++-4.7 library I am trying to create a MATLAB interface by coding a MexFunction using gigantic C++ library previously developed. For the tests I previously build and MexFunction only using and parsing XML files as inputs where paths are hardly defined within the function (for simplification and debugging), and I am not passing any input and output with *plhs and *prhs yet. My code includes MexFunction can be compiled with...

MATLAB.App File Type (to compile mex-files with Codewarrior on MacOSX) ?
Hello I am trying to compile a project (to have a mex-file at the end) with Codewarrior9 and Matlab7 (on a Mac). It works fine with Matlab5 and Codewarrior8, but not now. One of my problem is that Matlab5 was put in the project (I don't know how, it's not my project). Now I want to swap to Matlab7, but when I want to add it, Matlab7 appears as a directory (not in the Mac Finder though). The moderator of CW adviced me to check the extension of Matlab7 and add it to the mapping files settings of my project. However, I have no idea of what Matlab's File Type is. Also, CW asks me for ...

debugging mex files
Morning: CSSM I have programmed a complex MEX file in C, using VC++ 7.0 as my compiler. I am now searching for an optimal way to debug this MEX file using VC++ 7.0 preferably but the corresponding MATLAB documentation applies to Microsoft compiler versions 5/6. The listed commands do not even apply. Any help would be greatly appreciated, slp. ...

debug MEX file
Hi, Forgive me for the basic question, I really want to know how to debug a MEX file, Concretely, use LCC as complier, >> mex mycalc.c >> mycalc(3+5i) May someone can help that if i want to stop the program in some line and check value of local variables ?? Thank you all!! "Steven Zhang =D0=B4=B5=C0=A3=BA " > Hi, > > Forgive me for the basic question, I really want to know how to debug > a MEX file, > > Concretely, > use LCC as complier, > > >> mex mycalc.c > >> mycalc(3+5i) > > May someone can help that if i want to ...

matlab mex file
I want to create a mex file to be called by matlab. I have done all the basic stuff and got the examples to work. But now I want to create a much more ellaborate external c program. But all my calles to things like "strcta" or "CreateFile" which works well in MSVC6.0 fials to compile and link here. How do I do this? Thanks Henry henry terhani wrote: > I want to create a mex file to be called by matlab. I have done all > the basic stuff and got the examples to work. But now I want to > create a much more ellaborate external c program. But all my calles > to thin...

Matlab+VS 2008
Hi, Does anybody know whether it is possible to compile mex file under Visual Studio 2008 IDE? I found this instruction: http://coachk.cs.ucf.edu/GPGPU/Compiling_a_MEX_file_with_Visual_Studio2.htm which is similar to what can be found in a documentation. Setting options according either to the instruction or to the documentation (the only difference is additional option /export:mexFunction /dll) looks like this: /VERBOSE /OUT:"<proper path>\mex_decode.mexw32" /NOLOGO /MANIFEST / MANIFESTFILE:"Debug\mex_decode.mexw32.intermediate.manifest" / MANIFESTUAC:"level...

Matlab-MEX file
does any1 have idea how to convert "Matlab-Mex file" to c/c++ code ? I have 2 files; filename.mexw32 filename.mexglx and I want to see the contents of these files and edit them..If there is not any convertor,is it possible to edit these files with an editor? thanks in advance regards Dear Aydos! > I have 2 files; > filename.mexw32 > filename.mexglx > > and I want to see the contents of these files and edit them..If there is not any convertor,is it possible to edit these files with an editor? > thanks in advance There is no converter. You ha...

How to debug a mex file
My programming is like this: (1) I have a main programming main.m (2)In main.m I have a for loop to call c programming for example: for i=1:100 result1=calla(parameter1); result2=callb(parameter2); parameter1=callc( result2); end When executing it.Maybe i=1:60 There is no fault.But suddenly,It tells me a segment err. How can I debug it? Someone told me to use valgrind to see the primary memory error? How to debug the valgrind with matlab. Or is there any other tools I can use? Thank you for your attention On 25 Des, 14:54, "zedong " <zdon...@gmail.com> wrote: > ...

debugging mex file
Hi, is it possible to debug mex files? I woudl like to debug a mexclp.cpp file but I have no clue how it works or if it is possible. Thanks in advance. "Tobias " <tobias.aigner@elkraft.ntnu.no> wrote in message news:j8m3qd$f0k$1@newscl01ah.mathworks.com... > Hi, > > is it possible to debug mex files? > I woudl like to debug a mexclp.cpp file but I have no clue how it works or > if it is possible. Searching the documentation for "debug mex" found this page: http://www.mathworks.com/help/techdoc/matlab_external/f32489.html -- Steve Lord ...

debugging a MEX file
Hello; I want to debug a MEX file I created and use it in an M file. According to its instruction In the Help page, it is written that one should use 'Microsoft Development Environment Version 7.1' Could you please tell me which software I should use? VC++ 6 or .NET or sth else? Regards; ======== Address of relevant help page ========== (Matlab > External Interface > Creating C Language MEX File > Debugging C Language MEX File > Debugging on windows) Amir Hashemi schrieb: > Hello; > > I want to debug a MEX file I created and use it > in an M file. ...