Is it possible to debug mex code with Eclipse?

后端 未结 3 512
猫巷女王i
猫巷女王i 2020-12-29 08:00

I am trying to write some mex code but it is painful to debug it on the console with gbd. Is it possible to use Eclipse or the GUI of Matlab? If these are not feasible metho

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-29 08:18

    Debugging C/C++ MEX files in gdb is already comprehensively covered in the official documentation, so my suggestion is to try and integrate gdb with Eclipse CDT.

    There's plenty of information out there about how to do it properly, so I'm not going to repeat everything here. The best tutorial I know is IBM's two-part guide, "Interfacing with the CDT debugger":

    1. Part 1: Understand the C/C++ debugger interface - covers the high-level basics.
    2. Part 2: Accessing gdb with the Eclipse CDT and MI - explains how to make Eclipse work with gdb.

    I think part 2 is what you really need. Basically, you have to install a plug-in and configure it in Eclipse.

    There are also quite a few related questions about this even here on StackOverflow:

    1. How do I use GDB in Eclipse for C/C++ Debugging?
    2. How to install GDB debugger to Eclipse CDT
    3. Debugging with Eclipse CDT and GDB
    4. How can I enter commands to a gdb prompt while debugging with Eclipse CDT?

    I haven't tried it out yet, so I hope this works.

提交回复
热议问题