you could use listeners, but you could also use the dbstop ability to stop on condition, i.e.
dbstop in MFILE at LINENO if 'EXPRESSION'
where Expression is of the format:
You can also add these conditionss interactively in the editor by right clicking on the line number and adding a Conditional Breakpoint.
By adding these conditions your code will stop if the condition is true and you can debug from there.