After a long time away from using Xcode to work with C extensions, I am trying to get the debugging environment to work so that I can set breakpoints in Xcode and step through the cpp code while a SketchUp extension is executing it.
Is there a tutorial or documentation somewhere that describes the setup for this? I have done it before a long time ago but can’t remember the steps for configuring everything.
You need to ensure that SketchUp loads your Ruby C Extension from the build dir so breakpoints work. This might clash with your “normal” logic to load the Ruby C Extension. For this I often use startup args to modify where the extension loads the binary.
I don’t have a ready screenshot for Xcode, but it’d be similar to this VSCode setup:
This kind of setup has let me quickly jump into debugging my Ruby C extensions in VS/VSCode/Xcode without having to manually copy any files or modify source once it’s all setup.