How to debug a SwiftPM Command plugin that fails due to sandbox limitations, and not even print messages are visible

Hi

I have a command plugin that basically works
It runs successfully if I disable the sandbox

swift package --disable-sandbox plugin --allow-writing-to-package-directory plugin-name

However, running the same command without --disable-sandbox results in a crash dialog.

I do not even get print messages out on the terminal. Which is strange, since I add log / print messages on top of the program and not even they become visible.

Since the tool that is crashing comes from an old xcode project, I am having trouble debugging it. (but I can build it)

Are any hints, tips, or tricks available I could use?