Since your MIDAS application is written in a standard programming language, you can also use the standard debugger on your host system to debug that application. First, you compile and link your program with the debugger. E.g. for a Fortran program in Unix:
-I$MIDASHOME/$MIDVERS/incl -f smooth.for
% f77 -g -c smooth.f
% f77 smooth.o -L$MIDASHOME/$MIDVERS/lib -lmidas -o smooth.exe
Then you enter the MIDAS command DEBUG/MODULE and thereafter all modules executed from MIDAS are started with the host debugger enabled so you can inspect the source code, set breakpoints, etc. With the DEBUG/MODULE command you also turn the debug mode in MIDAS off, check the help for details.
Since there may be different debuggers available (on Unix systems, usually) the debugger of choice is saved in the keyword MID$SYS - this is done during the Midas installation. If you want to use a different debugger you have to modify that keyword appropriately.