Debugger enabled build exits immediately if launched from msys using rxvt or console.
This is because AllocConsole() doesn't initialize standard handles for the console. PDCurses needs standard handles to the console but doesn't check for them. It uses invalid handles and causes DOSBox to exit.
Attached patch seems to solve the problem.