Debug stop dbstop in Matlab Dynare

when I set debug stops before running Matlab>dynare modfile.mod or Matlab>modfile.m, they get cleard and no debug-stop occur. Debug stop works on single files but not when calling Matlab>dynare modfile.mod or Matlab>modfile.m (where modfile is just a model file name). How can I set a dbstop in dynare?

The parser normally writes a “clear all” at the top of every modfile.mod. This “clear all” resets part of the debug instructions.

In order to avoid it, do

dynare modfile noclearall

instead of

dynare modfile

but be careful of inherited global variables from previous because the memory isn’t cleared anymore. If you need to you can do clear all before the dbstop command

Kind regards