From: Dong T. <ti...@me...> - 2017-07-24 15:23:31
|
Hi Eric, all, Thanks for replying. It is non-trivial to attach the matlab process to gdb. Matlab provides a command line option -Dgdb to associate the Matlab process for gdb debugging. Would it be easier to launch "matlab-shell" with -Dgdb as option? Maybe your or someone else could put lights on this approach? Thanks, Dong On Wed, Jul 19, 2017 at 09:01:56PM +0000, Eric Ludlam wrote: > Hi Dong, > > You can fire up GDB from within Emacs and "attach" to a process. Using this to attach to a process running MATLAB inside Emacs' matlab-shell will let you debug through MATLAB code and into your C++ code. > > I haven't done this in a few years, and not with Mex (I was debugging MATLAB directly) but I'm guessing the principle is the same. > > Eric > > -----Original Message----- > From: Dong Tian [mailto:ti...@me...] > Sent: Wednesday, July 19, 2017 1:56 PM > To: mat...@li... > Subject: [Matlab-emacs-discuss] How to debug MEX files (C code) from Emacs? > > Hello, > > Could anyone provide a pointer on how to debug MEX files from Emacs? > E.g. using gdb? > > I am familiar with the procedure of debugging pure c/c++ code or .m code from Emacs using gdb, but I don't know a good way to debug MEX file coded in C from Emacs. > > Thanks in advance, > Dong > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss |