You can put lots of
debugln();
in there (essentially writeln)
Then you must start your app from console:
/path/to/yourapp/yourapp.app/Content/MacOS/yourapp
In project options check "display line numbers in run time error backtraces (-gl). This also prints to console
Make sure, that all used (or at least those that may be part of a stacktrace) packages, have debug info enabled.(open each package and check the options)
If you get a stacktrace, you can use "leak view" from tools menu.