I stuck an experimental OSX build up at:
http://dankulp.com/xlights/CodeBlocks-MAC-16.1.tar.gz
I stuck an experimental OSX build up at:
http://dankulp.com/xlights/CodeBlocks-MAC-16.1.tar.gz
I had a try of your tarball on Mac OS Yosemite. However, there's no lucky for me since your build requires Mac OS X 10.11 or later. Can you change your build SDK to OS X 10.10 or lower.
Can you give it another try? I added the -mmacosx-version-min=10.7 flag to all the compiles/links which hopefully fixes that. However, there are still a couple of plugins that won't load as I need to figure out how to pass some more link flags to them so they have enough space in the header to adjust the paths to the libs. Something for tomorrow. However, if you can at least see if CodeBlocks starts up, that would be a great start.That's great stuff!
Can you give it another try? I added the -mmacosx-version-min=10.7 flag to all the compiles/links which hopefully fixes that. However, there are still a couple of plugins that won't load as I need to figure out how to pass some more link flags to them so they have enough space in the header to adjust the paths to the libs. Something for tomorrow. However, if you can at least see if CodeBlocks starts up, that would be a great start.That's great stuff!
BTW: If you have built a working C::B, you could use C::B to build C::B and then the script mac_pack in the "src" folder. this way, all plugins should be fine (at least they were last time) and it makes a proper app package.
Any patches towards making this work are most welcome. We are hardly seeking Mac devs.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: changing install names or rpaths can't be redone for: /Users/dkulp/tmp/CodeBlocks.app/Contents/Resources/share/codeblocks/plugins/libautosave.so (for architecture x86_64) because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names)
so that's next to try and figure out. Most of the plugins work fine, just a few have this issue.Darn... I never understood why its so damn hard for an App package to get it right in the first place.
I've had very little luck getting it to build from within CB. Lots of flags need changing since I'm using clang and not gcc. I just discovered the field that you edit compiler flags in CB is changing all the -- to a single long hyphen which then breaks everything so I have to edit everything in the raw XML.A few months ago, I have done some work about CB compiled by clang and got a cbp or workspaces file to bootstrap C::B. Some modifications of mac_pack were also done. If it was useful to you, I can sent it to you by email. But your patches of C::B on Mac OS are more interesting for me.
The mac_pack is only semi-usable. I'm not using a monolithic wxwidgets so those parts are problematic. Also, when building from the command line, all the plugins get a .so extension, not .dylib. Apparently building from CB makes .dylibs which is interesting. In anycase, I have a similar mac_pack script that I'm using to try and assemble it.
Why don't just directly post the changes as a patch in this topic?Ok. I'm afraid that my patch is not full of testing. Please use it in your own risk. Some dependencies on GTK+ should be removed.
Ok. I'm afraid that my patch is not full of testing. Please use it in your own risk. Some dependencies on GTK+ should be removed.Good starting point do far... 3 questions:
* Did you try to do a re-build with these project files under Mac? does it work?Yes, it works on Mac OS Yosemite. But bugs should be fixed. Dan Kulp's pacthes are necessarily needed.
* Do you have a workspace file that covers all project files?I have a workspace file named by CodeBlocks_wx30-mac.workspace, it also works well.
* Why did you change update30 script, esp. removing the optional tools? This should actually work...Because the same scripts have been added to the corresponding cbp files, e.g. lib_finder_wx30-mac.cbp, etc.
It's a shame that CB isn't on GitHub and we could just submit pull pull requests...C::B is on GitHub, e.g. here:
It's a shame that CB isn't on GitHub and we could just submit pull pull requests...
I've attached my changes to the src tree. They pretty much fall into three categories:
1) Retina support - wxsdrawingwindow.cpp needs a bunch of changes to work properly on Retina screens. That said, this ALSO requires a bunch of patches to wxWidgets which have been submitted there. My fork of wxWidgets has the needed fixes:
https://github.com/dkulp/wxWidgets/tree/WX_3_0_BRANCH
2) Plugin loading - when building from command line and running "make install", plugins are in a different place and named differently than when built form within CB and/or packaged in an app. The patch tries to account for the various options.
3) Minor startup performance thing - for some reason (not sure why), a bunch of the png files are being copied during make install which is causing wxImage to not be valid which takes a second per image to generate a stack trace. Ideally, I'd fix the image copying, but for now, if the image is no OK, use a null bitmap.
$ git clone https://github.com/wxWidgets/wxWidgets.git -b WX_3_0_BRANCH --depth=1
$ cd wxWidgets
$ mkdir cocoabuild && cd cocoabuild
$ ../configure --enable-monolithic --with-macosx-version-min=10.7 --enable-debug=no --with-cocoa CXXFLAGS="-stdlib=libc++ -std=c++11" OBJCXXFLAGS="-stdlib=libc++ -std=c++11" CPPFLAGS="-stdlib=libc++" LDFLAGS="-stdlib=libc++" CXX=clang++ CXXCPP="clang++ -E" CC=clang CPP="clang -E" --enable-shared --enable-unicode --enable-threads --without-subdirs
$ make
Hi, Dan! I have made another try to build CB on Mac OS by merging your patches into CB source tree. My steps are as follows:Code: bashthen do some patches and bootstrap CB by CB.$ git clone https://github.com/wxWidgets/wxWidgets.git -b WX_3_0_BRANCH --depth=1
$ cd wxWidgets
$ mkdir cocoabuild && cd cocoabuild
$ ../configure --enable-monolithic --with-macosx-version-min=10.7 --enable-debug=no --with-cocoa CXXFLAGS="-stdlib=libc++ -std=c++11" OBJCXXFLAGS="-stdlib=libc++ -std=c++11" CPPFLAGS="-stdlib=libc++" LDFLAGS="-stdlib=libc++" CXX=clang++ CXXCPP="clang++ -E" CC=clang CPP="clang -E" --enable-shared --enable-unicode --enable-threads --without-subdirs
$ make
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<true/>
The binary file is located at
https://fedorapeople.org/~easior/CodeBlocks-Mac-16.1-r1.tar.bz2.
I found that some bugs are fixed, e.g. changing font size in CB Editor does not make CB crash. However, my binary file is full of bugs. For examples:
* mouse scrolling in CB Editor with some source codes will make CB crashed;
* Compiler plugin does not work well because the build target of project to build is not displayed on compiler toolbar.
The attachment is the patch which have been merged together.
They are in my fork of wxWidgets:
https://github.com/dkulp/wxWidgets
on the WX_3_0_BRANCH branch there. I've submitted pull requests back, but they haven't applied them yet.
../src/osx/cocoa/window.mm:514:50: warning: 'convertBaseToScreen:' is deprecated: first deprecated in OS X 10.7 - Use -convertRectToScreen: instead [-Wdeprecated-declarations]
locationInWindow = [[nsEvent window] convertBaseToScreen:locationInWindow];
^
/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:661:1: note: 'convertBaseToScreen:' has been explicitly marked deprecated here
- (NSPoint)convertBaseToScreen:(NSPoint)aPoint __attribute__((availability(macosx,introduced=10.0 ,deprecated=10.7,message="" "Use -convertRectToScreen: instead")));
^
../src/osx/cocoa/window.mm:517:52: warning: 'convertScreenToBase:' is deprecated: first deprecated in OS X 10.7 - Use -convertRectFromScreen: instead [-Wdeprecated-declarations]
locationInWindow = [[m_osxView window] convertScreenToBase:locationInWindow];
^
/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:662:1: note: 'convertScreenToBase:' has been explicitly marked deprecated here
- (NSPoint)convertScreenToBase:(NSPoint)aPoint __attribute__((availability(macosx,introduced=10.0 ,deprecated=10.7,message="" "Use -convertRectFromScreen: instead")));
^
../src/osx/cocoa/window.mm:2439:46: error: use of undeclared identifier 'NSTextAlignmentCenter'
[paragraphStyle setAlignment:NSTextAlignmentCenter];
^
../src/osx/cocoa/window.mm:2461:24: warning: 'NSView' may not respond to 'setAttributedTitle:'
[m_osxView setAttributedTitle:attrString];
~~~~~~~~~ ^
../src/osx/cocoa/window.mm:2886:40: warning: 'convertScreenToBase:' is deprecated: first deprecated in OS X 10.7 - Use -convertRectFromScreen: instead [-Wdeprecated-declarations]
location = [[m_osxView window] convertScreenToBase:location];
^
/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:662:1: note: 'convertScreenToBase:' has been explicitly marked deprecated here
- (NSPoint)convertScreenToBase:(NSPoint)aPoint __attribute__((availability(macosx,introduced=10.0 ,deprecated=10.7,message="" "Use -convertRectFromScreen: instead")));
^
4 warnings and 1 error generated.
make: *** [monodll_osx_cocoa_window.o] Error 1
The scrolling crash looks like it's in Scintilla which I know nothing about.Hi, Dan! Could you share any experiences on how to debug the CB binary? Is there any effective debugging tool to be recommended?
I stuck a new binary up at:Unfortunately, Your binary also has a bug. It will crash if you open a c++ source code and format it by choosing format use astyle in a popup menu with right mouse clicking.
http://dankulp.com/xlights/CodeBlocks-MAC-16.1.tar.gz
I made another build which is more stable than ever....where?! :-)
The following attachments are the recently crashing report.Did you strip the sources? Because all lines are missing. For the development on the Mac you should not strip anything. This will help to track down the errors.
...wrt the patch you kindly provided: The method:
m_Bitmap->CreateScaled
...is not available on wx2.8.x. Therefore the build will be broken with that version. You'll need to wrap this into a wxCHECK_VERSION or alike.
Personally, I would suggest requiring 3.0.x for the Mac.I have not problem with that, but as long as we don't have a stable wx3.0 for all platforms we need to consider using wx28 on other platforms as base.
#ifdef wxCHECK_VERSION(3, 0, 0)
... // new code
#else
... // old code
#endif
...where?! :-)
Did you strip the sources? Because all lines are missing. For the development on the Mac you should not strip anything. This will help to track down the errors.Ok. I have changed the value of variable CB_RELEASE_TYPE from -O2 to -g and temporally comment all strip scripts in update30.
Did you strip the sources? Because all lines are missing. For the development on the Mac you should not strip anything. This will help to track down the errors.
<?xml version="1.0" encoding="UTF-8"?>
<report version="1.0" kind="exception">
<system description="Mac OS X (Darwin 14.5.0 x86_64)"/>
<stack>
<frame level="0" function="wxDebugReport::AddContext(wxDebugReport::Context) " offset="00000000" file="debugrpt.cpp" line="49"/>
<frame level="1" function="wxDebugReport::AddAll(wxDebugReport::Context) " offset="00000000" file="debugrpt.cpp" line="35"/>
<frame level="2" function="CodeBlocksApp::OnFatalException() " offset="00000000" file="app.cpp" line="88"/>
<frame level="3" function="wxFatalSignalHandler " offset="00000000" file="utilsunx.cpp" line="139"/>
<frame level="4" function="_sigtramp " offset="00000000"/>
<frame level="5" function="_sigtramp " offset="00000000"/>
<frame level="6" function="CallTip::CallTipCancel() " offset="00000000" file="CallTip.cxx" line="30"/>
<frame level="7" function="ScintillaBase::WndProc(unsigned int, unsigned long, long) " offset="00000000" file="ScintillaBase.cxx" line="92"/>
<frame level="8" function="ScintillaWX::WndProc(unsigned int, unsigned long, long) " offset="00000000" file="ScintillaWX.cpp" line="94"/>
<frame level="9" function="wxScintilla::SendMsg(unsigned int, unsigned long, long) const " offset="00000000" file="wxscintilla.cpp" line="26"/>
<frame level="10" function="wxScintilla::CallTipCancel() " offset="00000000" file="wxscintilla.cpp" line="200"/>
<frame level="11" function="cbStyledTextCtrl::CallTipCancel() " offset="00000000" file="cbstyledtextctrl.cpp" line="33"/>
<frame level="12" function="cbStyledTextCtrl::OnKillFocus(wxFocusEvent&) " offset="00000000" file="cbstyledtextctrl.cpp" line="8"/>
<frame level="13" function="wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const " offset="00000000" file="appbase.cpp" line="61"/>
<frame level="14" function="wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const " offset="00000000" file="appbase.cpp" line="62"/>
<frame level="15" function="wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) " offset="00000000" file="event.cpp" line="139"/>
<frame level="16" function="wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) " offset="00000000" file="event.cpp" line="99"/>
<frame level="17" function="wxEvtHandler::TryHereOnly(wxEvent&) " offset="00000000" file="event.cpp" line="158"/>
<frame level="18" function="wxEvtHandler::TryBeforeAndHere(wxEvent&) " offset="00000000" file="event.h" line="367"/>
<frame level="19" function="wxEvtHandler::ProcessEvent(wxEvent&) " offset="00000000" file="event.cpp" line="148"/>
<frame level="20" function="wxEvtHandler::DoTryChain(wxEvent&) " offset="00000000" file="event.cpp" line="155"/>
<frame level="21" function="wxEvtHandler::ProcessEventLocally(wxEvent&) " offset="00000000" file="event.cpp" line="152"/>
<frame level="22" function="wxEvtHandler::ProcessEvent(wxEvent&) " offset="00000000" file="event.cpp" line="149"/>
<frame level="23" function="wxEvtHandler::SafelyProcessEvent(wxEvent&) " offset="00000000" file="event.cpp" line="161"/>
<frame level="24" function="wxWindowBase::HandleWindowEvent(wxEvent&) const " offset="00000000" file="wincmn.cpp" line="152"/>
<frame level="25" function="wxWidgetCocoaImpl::DoNotifyFocusEvent(bool, wxWidgetImpl*) " offset="00000000" file="window.mm" line="287"/>
<frame level="26" function="wxWidgetCocoaImpl::DoNotifyFocusLost() " offset="00000000" file="window.mm" line="283"/>
<frame level="27" function="wxWidgetCocoaImpl::resignFirstResponder(NSView*, void*) " offset="00000000" file="window.mm" line="153"/>
<frame level="28" function="wxOSX_resignFirstResponder(NSView*, objc_selector*) " offset="00000000" file="window.mm" line="105"/>
<frame level="29" function="-[NSWindow makeFirstResponder:] " offset="00000000"/>
<frame level="30" function="-[wxNSWindow makeFirstResponder:] " offset="00000000" file="nonownedwnd.mm" line="21"/>
<frame level="31" function="-[wxNonOwnedWindowController windowDidResignKey:] " offset="00000000" file="nonownedwnd.mm" line="50"/>
<frame level="32" function="__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ " offset="00000000"/>
<frame level="33" function="_CFXNotificationPost " offset="00000000"/>
<frame level="34" function="-[NSNotificationCenter postNotificationName:object:userInfo:] " offset="00000000"/>
<frame level="35" function="-[NSWindow resignKeyWindow] " offset="00000000"/>
<frame level="36" function="-[NSWindow _changeKeyAndMainLimitedOK:] " offset="00000000"/>
<frame level="37" function="-[NSWindow _makeKeyRegardlessOfVisibility] " offset="00000000"/>
<frame level="38" function="-[NSWindow makeKeyAndOrderFront:] " offset="00000000"/>
<frame level="39" function="wxNonOwnedWindowCocoaImpl::Show(bool) " offset="00000000" file="nonownedwnd.mm" line="77"/>
<frame level="40" function="wxNonOwnedWindow::Show(bool) " offset="00000000" file="nonownedwnd_osx.cpp" line="37"/>
<frame level="41" function="Window::Show(bool) " offset="00000000" file="PlatWX.cpp" line="80"/>
<frame level="42" function="ScintillaWX::WndProc(unsigned int, unsigned long, long) " offset="00000000" file="ScintillaWX.cpp" line="92"/>
<frame level="43" function="wxScintilla::SendMsg(unsigned int, unsigned long, long) const " offset="00000000" file="wxscintilla.cpp" line="26"/>
<frame level="44" function="wxScintilla::CallTipShow(int, wxString const&) " offset="00000000" file="wxscintilla.cpp" line="200"/>
<frame level="45" function="CCManager::DoShowTips(std::__1::vector<wxString, std::__1::allocator<wxString> > const&, cbStyledTextCtrl*, int, int, int, int) " offset="00000000" file="ccmanager.cpp" line="137"/>
<frame level="46" function="CCManager::OnEditorTooltip(CodeBlocksEvent&) " offset="00000000" file="ccmanager.cpp" line="71"/>
<frame level="47" function="cbEventFunctor<CCManager, CodeBlocksEvent>::Call(CodeBlocksEvent&) " offset="00000000" file="cbfunctor.h" line="4"/>
<frame level="48" function="Manager::ProcessEvent(CodeBlocksEvent&) " offset="00000000" file="manager.cpp" line="26"/>
<frame level="49" function="PluginManager::NotifyPlugins(CodeBlocksEvent&) " offset="00000000" file="pluginmanager.cpp" line="145"/>
<frame level="50" function="cbEditor::NotifyPlugins(int, int, wxString const&, int, int) " offset="00000000" file="cbeditor.cpp" line="82"/>
<frame level="51" function="cbEditor::OnEditorDwellStart(wxScintillaEvent&) " offset="00000000" file="cbeditor.cpp" line="327"/>
<frame level="52" function="wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const " offset="00000000" file="appbase.cpp" line="61"/>
<frame level="53" function="wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const " offset="00000000" file="appbase.cpp" line="62"/>
<frame level="54" function="wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) " offset="00000000" file="event.cpp" line="139"/>
<frame level="55" function="wxEvtHandler::SearchDynamicEventTable(wxEvent&) " offset="00000000" file="event.cpp" line="174"/>
<frame level="56" function="wxEvtHandler::TryHereOnly(wxEvent&) " offset="00000000" file="event.cpp" line="158"/>
<frame level="57" function="wxEvtHandler::TryBeforeAndHere(wxEvent&) " offset="00000000" file="event.h" line="367"/>
<frame level="58" function="wxEvtHandler::ProcessEventLocally(wxEvent&) " offset="00000000" file="event.cpp" line="152"/>
<frame level="59" function="wxEvtHandler::ProcessEvent(wxEvent&) " offset="00000000" file="event.cpp" line="149"/>
<frame level="60" function="wxWindowBase::TryAfter(wxEvent&) " offset="00000000" file="wincmn.cpp" line="342"/>
<frame level="61" function="wxEvtHandler::TryAfter(wxEvent&) " offset="00000000" file="event.cpp" line="144"/>
<frame level="62" function="wxEvtHandler::ProcessEvent(wxEvent&) " offset="00000000" file="event.cpp" line="150"/>
<frame level="63" function="wxScintilla::NotifyParent(SCNotification*) " offset="00000000" file="wxscintilla.cpp" line="570"/>
<frame level="64" function="ScintillaWX::NotifyParent(SCNotification) " offset="00000000" file="ScintillaWX.cpp" line="54"/>
<frame level="65" function="Editor::NotifyDwelling(Point, bool) " offset="00000000" file="Editor.cxx" line="240"/>
<frame level="66" function="Editor::TickFor(Editor::TickReason) " offset="00000000" file="Editor.cxx" line="465"/>
<frame level="67" function="ScintillaWX::DoOnTimer(wxTimerEvent&) " offset="00000000" file="ScintillaWX.cpp" line="132"/>
<frame level="68" function="wxScintilla::OnTimer(wxTimerEvent&) " offset="00000000" file="wxscintilla.cpp" line="550"/>
<frame level="69" function="wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const " offset="00000000" file="appbase.cpp" line="61"/>
<frame level="70" function="wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const " offset="00000000" file="appbase.cpp" line="62"/>
<frame level="71" function="wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) " offset="00000000" file="event.cpp" line="139"/>
<frame level="72" function="wxEvtHandler::SearchDynamicEventTable(wxEvent&) " offset="00000000" file="event.cpp" line="174"/>
<frame level="73" function="wxEvtHandler::TryHereOnly(wxEvent&) " offset="00000000" file="event.cpp" line="158"/>
<frame level="74" function="wxEvtHandler::TryBeforeAndHere(wxEvent&) " offset="00000000" file="event.h" line="367"/>
<frame level="75" function="wxEvtHandler::ProcessEventLocally(wxEvent&) " offset="00000000" file="event.cpp" line="152"/>
<frame level="76" function="wxEvtHandler::ProcessEvent(wxEvent&) " offset="00000000" file="event.cpp" line="149"/>
<frame level="77" function="wxEvtHandler::SafelyProcessEvent(wxEvent&) " offset="00000000" file="event.cpp" line="161"/>
<frame level="78" function="wxTimerImpl::SendEvent() " offset="00000000" file="timerimpl.cpp" line="5"/>
<frame level="79" function="wxTimer::Notify() " offset="00000000" file="timercmn.cpp" line="10"/>
<frame level="80" function="wxTimerImpl::Notify() " offset="00000000" file="timer.h" line="4"/>
<frame level="81" function="wxProcessTimer(__CFRunLoopTimer*, void*) " offset="00000000" file="timer.cpp" line="3"/>
<frame level="82" function="__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ " offset="00000000"/>
<frame level="83" function="__CFRunLoopDoTimer " offset="00000000"/>
<frame level="84" function="__CFRunLoopDoTimers " offset="00000000"/>
<frame level="85" function="__CFRunLoopRun " offset="00000000"/>
<frame level="86" function="CFRunLoopRunSpecific " offset="00000000"/>
<frame level="87" function="RunCurrentEventLoopInMode " offset="00000000"/>
<frame level="88" function="ReceiveNextEventCommon " offset="00000000"/>
<frame level="89" function="_BlockUntilNextEventMatchingListInModeWithFilter " offset="00000000"/>
<frame level="90" function="_DPSNextEvent " offset="00000000"/>
<frame level="91" function="-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] " offset="00000000"/>
<frame level="92" function="-[NSApplication run] " offset="00000000"/>
<frame level="93" function="wxGUIEventLoop::OSXDoRun() " offset="00000000" file="evtloop.mm" line="30"/>
<frame level="94" function="wxCFEventLoop::DoRun() " offset="00000000" file="evtloop_cf.cpp" line="34"/>
<frame level="95" function="wxEventLoopBase::Run() " offset="00000000" file="evtloopcmn.cpp" line="7"/>
<frame level="96" function="wxAppConsoleBase::MainLoop() " offset="00000000" file="appbase.cpp" line="33"/>
<frame level="97" function="wxAppConsoleBase::OnRun() " offset="00000000" file="appbase.cpp" line="25"/>
<frame level="98" function="wxAppBase::OnRun() " offset="00000000" file="appcmn.cpp" line="30"/>
<frame level="99" function="wxApp::OnRun() " offset="00000000" file="app.cpp" line="92"/>
<frame level="100" function="CodeBlocksApp::OnRun() " offset="00000000" file="app.cpp" line="85"/>
<frame level="101" function="wxEntry(int&, wchar_t**) " offset="00000000" file="init.cpp" line="50"/>
<frame level="102" function="wxEntry(int&, char**) " offset="00000000" file="init.cpp" line="51"/>
<frame level="103" function="main " offset="00000000" file="app.cpp" line="32"/>
<frame level="104" function="start " offset="00000000"/>
</stack>
</report>
Does it happen every time or is it just some random event?
You can try to start cb under lldb/gdb and wait for the crash to happen.
Then inspect the variables.
The line numbers in the crash report are totally wrong (the last character is removed).
Process 62378 stopped
* thread #1: tid = 0x7770f, 0x0000000101f9025d libcodeblocks.dylib`Window::Destroy(this=0x0000000110f2ed90) + 61 at PlatWX.cpp:764, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x0000000101f9025d libcodeblocks.dylib`Window::Destroy(this=0x0000000110f2ed90) + 61 at PlatWX.cpp:764
761 {
762 if (wid) {
763 Show(false);
-> 764 GETWIN(wid)->Destroy();
765 }
766 wid = 0;
767 }
(lldb)
Any suggestion?Am I correct in my guess that the calltip is cancelled while it is being created?
Am I correct in my guess that the calltip is cancelled while it is being created?
Probably you can add a flag that marks the beginning/end of the calltip creation and then don't call the cancel function if this flag is set.How to add a flag? Do you mean that setting a breakpoint in lldb to debug CB?
I don't know whether you are correct or not since I'm not familiar with the CB sources.Just inspect the backtrace. The name of the function on it will reveal what is going on.
How to add a flag? Do you mean that setting a breakpoint in lldb to debug CB?Modify the source by adding a bool flag then when you start the method that creates the calltip set it to true, when the method exits set it to false. Lastly add a check if the flag is set in the onkillfocus method.
If I remember correctly, there are similar crashes under Windows system several years ago, and later we fixed it. You need to search the forum to find the discussions. oBFusCATed's explanation is reasonable as I can see.Does it happen every time or is it just some random event?
It happened while mouse scrolling in CB editor with some source codes.Quote from: oBFusCATedYou can try to start cb under lldb/gdb and wait for the crash to happen.
Then inspect the variables.
The line numbers in the crash report are totally wrong (the last character is removed).
Thanks. lldb is used by me this time to debug and it gives some information as follow:Code: bashProcess 62378 stopped
* thread #1: tid = 0x7770f, 0x0000000101f9025d libcodeblocks.dylib`Window::Destroy(this=0x0000000110f2ed90) + 61 at PlatWX.cpp:764, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x0000000101f9025d libcodeblocks.dylib`Window::Destroy(this=0x0000000110f2ed90) + 61 at PlatWX.cpp:764
761 {
762 if (wid) {
763 Show(false);
-> 764 GETWIN(wid)->Destroy();
765 }
766 wid = 0;
767 }
(lldb)
Any suggestion?
Index: src/sdk/globals.cpp
===================================================================
--- src/sdk/globals.cpp (revision 10805)
+++ src/sdk/globals.cpp (working copy)
@@ -58,7 +58,7 @@
#ifndef __WXMAC__
const wxString DEFAULT_CONSOLE_TERM = _T("xterm -T $TITLE -e");
#else
-const wxString DEFAULT_CONSOLE_TERM = _T("osascript -e 'tell app \"Terminal\"' -e 'activate' -e 'do script \"$SCRIPT\"' -e 'end tell'");
+const wxString DEFAULT_CONSOLE_TERM = _T("osascript -e 'tell app \"Terminal\"' -e 'activate' -e 'do script quoted form of \"$SCRIPT\"' -e 'end tell'");
#endif
const wxString DEFAULT_CONSOLE_SHELL = _T("/bin/sh -c");
I stuck an experimental OSX build up at:
http://dankulp.com/xlights/CodeBlocks-MAC-16.1.tar.gz
This is using a custom build of wxWidgets 3.0.x which is the latest code from git + a bunch of fixes that I submitted back to them in a pull request. It also contains some fixes to Code::Blocks to get it working on MAC, particularly finding plugins with the ".app" as well as some fixes for Retina displays. Not all those fixes are submitted back yet.
Very minimal testing has been done as I pretty much just use it for wxSmith.
<?xml version="1.0" encoding="UTF-8"?>
<report version="1.0" kind="exception">
<system description="Mac OS X (Darwin 16.0.0 x86_64)"/>
<stack>
<frame level="0" function="wxFatalSignalHandler " offset="00000000"/>
<frame level="1" function="_sigtramp " offset="00000000"/>
<frame level="2" function="_sigtramp " offset="00000000"/>
<frame level="3" function="wxEncodingConverter::Init(wxFontEncoding, wxFontEncoding, int) " offset="00000000"/>
<frame level="4" function="EncodingDetector::ConvertToWxString(unsigned char const*, unsigned long) " offset="00000000"/>
<frame level="5" function="EncodingDetector::DetectEncoding(unsigned char const*, unsigned long, bool) " offset="00000000"/>
<frame level="6" function="EncodingDetector::DetectEncoding(wxString const&, bool) " offset="00000000"/>
<frame level="7" function="EncodingDetector::EncodingDetector(wxString const&, bool) " offset="00000000"/>
<frame level="8" function="wxsCoder::FlushFile(wxString const&) " offset="00000000"/>
<frame level="9" function="wxsCoder::AddCode(wxString const&, wxString const&, wxString const&, wxString const&, bool, bool, bool) " offset="00000000"/>
<frame level="10" function="wxWidgetsGUI::OnRebuildApplicationCode() " offset="00000000"/>
<frame level="11" function="(anonymous namespace)::AddWxExtensions(cbProject*, wxString const&, wxString const&, wxString const&, wxString const&) " offset="00000000"/>
<frame level="12" function="long SqPlus::ReturnSpecialization<void>::Call<cbProject*, wxString const&, wxString const&, wxString const&, wxString const&>(void (*)(cbProject*, wxString const&, wxString const&, wxString const&, wxString const&), SQVM*, long) " offset="00000000"/>
<frame level="13" function="SqPlus::DirectCallFunction<void (*)(cbProject*, wxString const&, wxString const&, wxString const&, wxString const&)>::Dispatch(SQVM*) " offset="00000000"/>
<frame level="14" function="SQVM::CallNative(SQNativeClosure*, long, long, SQObjectPtr&, bool&) " offset="00000000"/>
<frame level="15" function="SQVM::Execute(SQObjectPtr&, long, long, long, SQObjectPtr&, unsigned long, SQVM::ExecutionType) " offset="00000000"/>
<frame level="16" function="SQVM::Call(SQObjectPtr&, long, long, SQObjectPtr&, unsigned long) " offset="00000000"/>
<frame level="17" function="sq_call " offset="00000000"/>
<frame level="18" function="bool SqPlus::SquirrelFunction<bool>::operator()<cbProject*>(cbProject*) " offset="00000000"/>
<frame level="19" function="Wiz::RunProjectWizard(wxString*) " offset="00000000"/>
<frame level="20" function="Wiz::Launch(int, wxString*) " offset="00000000"/>
<frame level="21" function="TemplateManager::New(TemplateOutputType, wxString*) " offset="00000000"/>
<frame level="22" function="MainFrame::OnFileNewWhat(wxCommandEvent&) " offset="00000000"/>
<frame level="23" function="MainFrame::OnStartHereLink(wxCommandEvent&) " offset="00000000"/>
<frame level="24" function="wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) " offset="00000000"/>
<frame level="25" function="wxEvtHandler::ProcessEventLocally(wxEvent&) " offset="00000000"/>
<frame level="26" function="wxEvtHandler::ProcessEvent(wxEvent&) " offset="00000000"/>
<frame level="27" function="wxEvtHandler::ProcessPendingEvents() " offset="00000000"/>
<frame level="28" function="wxAppConsoleBase::ProcessPendingEvents() " offset="00000000"/>
<frame level="29" function="wxCFEventLoop::OSXCommonModeObserverCallBack(__CFRunLoopObserver*, int, void*) " offset="00000000"/>
<frame level="30" function="__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ " offset="00000000"/>
<frame level="31" function="__CFRunLoopDoObservers " offset="00000000"/>
<frame level="32" function="__CFRunLoopRun " offset="00000000"/>
<frame level="33" function="CFRunLoopRunSpecific " offset="00000000"/>
<frame level="34" function="RunCurrentEventLoopInMode " offset="00000000"/>
<frame level="35" function="ReceiveNextEventCommon " offset="00000000"/>
<frame level="36" function="_BlockUntilNextEventMatchingListInModeWithFilter " offset="00000000"/>
<frame level="37" function="_DPSNextEvent " offset="00000000"/>
<frame level="38" function="-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] " offset="00000000"/>
<frame level="39" function="-[NSApplication run] " offset="00000000"/>
<frame level="40" function="wxGUIEventLoop::OSXDoRun() " offset="00000000"/>
<frame level="41" function="wxCFEventLoop::DoRun() " offset="00000000"/>
<frame level="42" function="wxEventLoopBase::Run() " offset="00000000"/>
<frame level="43" function="wxAppConsoleBase::MainLoop() " offset="00000000"/>
<frame level="44" function="wxApp::OnRun() " offset="00000000"/>
<frame level="45" function="CodeBlocksApp::OnRun() " offset="00000000"/>
<frame level="46" function="wxEntry(int&, wchar_t**) " offset="00000000"/>
<frame level="47" function="main " offset="00000000"/>
<frame level="48" function="start " offset="00000000"/>
</stack>
</report>