You have two ways for doing that first you could compile matlab to c files and debug it with gdb see here. You have another solution and it's the hardest that you should debug matlab over the matlab ...
This can lead to unexpected behavior (e.g. crashes, memory corruptions, etc.) when linking arrow.dll against other code that is built against a different MSVC Runtime (e.g. a non- Debug version). We ...