Another useful tecnique is to open a (txt) file for append
and write some infos in it
(like "Stepped in this sub", "found this value", "raised this error"...)