Debug plugin?

I know this has been discussed a number of times over the years dating back to RB/RS, but does anyone have a step-by-step guide on how to debug a plugin at the source level, that is called by a Xojo app?
I write my plugins in C/C++ using Xcode, and I’d love to be able to step through it line by line in Xcode to debug it. Right now it’s a painful process of elimination, writing variables out to disk, etc to try to track down plugin bugs.
I’ve never gotten this to work in the past with RB/RS, and there is a dearth of information on this topic re: Xojo/Xcode.
Many thanks,