Hello Code::Blocks team,
I am a beginner C++ user on a MacBook Air with Apple silicon, running macOS 27.0.1. The official Code::Blocks 25.03 x64 .dmg did not work for me. It crashed on startup in the CodeCompletion plugin, it crashed on exit in wxSmith, and under Rosetta it could not compile anything (unable to load libxcrun). While working around this, I built 25.03 natively for arm64 from the release tarball and found a few small bugs on the way. I am sending everything for your review in the attached archive, codeblocks-25.03-macos-arm64-src.tar.gz.
What is in the archive
patches/codeblocks-25.03-macos-fixes.patch, about 10 lines; applies cleanly to the 25.03 tarball):src/src/main.cpp: on macOS, "Quit Code::Blocks" in the application menu and Cmd+Q use wxID_EXIT, which Code::Blocks does not handle. wxOSX then just calls ExitMainLoop(), so MainFrame::OnApplicationClose() never runs. As a result default.conf is not saved and plugins are not released. The patch binds wxID_EXIT to OnFileQuit under __WXOSX__. I confirmed the call path with a backtrace.wxsresourcetreeitemdata.cpp: ~wxsResourceTree() clears the singleton before the base tree control deletes its items, so ~wxsResourceTreeItemData() dereferences NULL on exit. The patch adds a NULL check.scripts/build_all.sh) that turns the release tarball into a self-contained, ad-hoc signed CodeBlocks.app. Two notes on the build system: configure does not check for Boost, which NassiShneiderman needs, and bundle.sh bundles only the wx libraries and does not sign the app.A working debugger on Apple silicon. GDB is not available there, and 25.03 ships only an empty dap_debugger folder. I used the third-party debugger_DAP plugin (originally by Andrew Cottrell, now at github.com/pecanh/debugger_DAP, GPL-3.0) with Apple's lldb-dap, and fixed five macOS problems in it:
ss commandwxDialog docked as a pane, and it was added hiddenWith these fixes, stepping, line breakpoints, locals in Watches and program output all work. The patch and the patched plugin source are included.
Documentation (docs/): the original bug report with stack traces, build steps, test results and known limitations.
What I could not solve
ClassBrowser::SetParser happens only with the official x64 .dmg. I could not reproduce it in the native build, so I did not find its cause.The macOS 27 crash reports and the Code::Blocks debug report are available if they would help.
I hope some of this is useful, especially the two small patches and maybe an official arm64 macOS build. I am happy to test anything on my machine.
Thank you for Code::Blocks!
Best regards,
Mladen Markovic
Small patches applied in [r14064], thank you.
Related
Commit: [r14064]
Re: debugger_dap. Thanks.
I'm on the road right now but will attend to your patch as soon as possible.