Archicad C++ API
About Archicad add-on development using the C++ API.

Debug AddOns in XCode (macOS, AC15)

Anonymous
Not applicable
Hello!

I have no problem when debug AddOns in the Windows.
And in the macOS my addons, compiled with XCode 3.2.1, work properly.

But I don't undestand how attach XCode debugger to debug my AddOns in the macOS.

Please, help who know ).
12 REPLIES 12
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi Tsepov,

If ArchiCAD is already running, you can do it in Product / Attach to Process menu selecting ArchiCAD from the applications.

Best regards,
Tibor
Anonymous
Not applicable
Thank You, Tibor!
But i get an error
"No launchable executable present at path"
And it means that i was did all rightly. May be my problem that to test the debugger I use VMWare (I try compiling for Mac OS in the virtual machine on Win)...
Ralph Wessel
Mentor
Tsepov wrote:
But I don't undestand how attach XCode debugger to debug my AddOns in the Mac OS.
If you're using Xcode 3.x, you can define one or more executables to be launched for debugging. Look at the Executables section in the list of Groups & Files. If you right-click, you can add ArchiCAD to the list (see attached image). Then when you start debugging, it will launch ArchiCAD and the debugger will attach to it.
Ralph Wessel BArch
Software Engineer Speckle Systems
Ralph Wessel
Mentor
Tsepov wrote:
But I don't undestand how attach XCode debugger to debug my AddOns in the Mac OS
For Xcode 4.x, it's slightly different (better IMO). You define the debugging executable in the relevant scheme (see attached image). When you run, the debugger attaches to the specified executable.
xcode463.jpeg
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Thank you very much!
Everything works as it should!
Sincerely, Yury
Anonymous
Not applicable
Hi !

I'm unearthing this old post in order to keep info centralized.
I am too having a problem with XCode debugging : As i attach XCode to ArchiCAD, open the XCode console and launch my addon, I can not see any output, despite the console being set to "All Output".

Using breakpoints doesn't help me much either, as I sometimes end up with and lldb prompt in the console, or with dessassemblied ASM to go through when I try to use any sort of breakpoint / pause etc.

I have already gone through what is on this page : http://archicadapi.graphisoft.com/tools-for-debugging?_ga=2.8108533.691920868.1524568776-219266765.1... , and I have no difficulty obtaining debug output on Visual Studio.

I am running this inside a High Sierra VM , and AC21.

Do you have any leads for me ? Thanks !
Ralph Wessel
Mentor
Sounds like you're building with a release configuration. Check the active scheme to ensure it's set to build the debug configuration (and that the build target has the appropriate debug settings).
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Checked my project, It was building in Debug mode, so I guess that's not the problem.

As i am a beginner using XCode, I tried using an Example plugin, peppering it with DBPrintf statements and running it while attached to ArchiCAD in case I botched the settings on my own project, but no more luck : still nothing in the console.
I opened the View>Debug Area>Activate Console window, could you confirm me It's the right one ?
Ralph Wessel
Mentor
Yep, that should display the console output from DBPrintf – and it should write the console log even when running the release build. How are you launching ARCHICAD?
Ralph Wessel BArch
Software Engineer Speckle Systems