Alright here is a call graph.
I built this using the scripts provided by PaulNavin a couple of weeks ago. Which seems to be working pretty good, I had to move the plugins inside the bundle for cb to find them but other then that everything looks ok. This is revision 7458 but the splash screen says 7456.
I haven't verified this with my friend but I guess it the same problem as he had, cb hangs and the last line in the log is "Create new parser for 'test1'". If I disable cc won't hang.
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6
Call graph:
2373 Thread_50720 DispatchQueue_1: com.apple.main-thread (serial)
2373 start
2373 main
2373 wxEntry(int&, wchar_t**)
2373 CodeBlocksApp::OnRun()
2373 wxAppBase::MainLoop()
2373 wxEventLoopManual::Run()
2373 wxEventLoop::Dispatch()
2373 wxApp::MacDoOneEvent()
2373 wxApp::MacHandleOneEvent(void*)
2373 wxMacProcessNotifierAndPendingEvents
2373 wxAppConsole::ProcessPendingEvents()
2373 wxEvtHandler::ProcessPendingEvents()
2373 wxEvtHandler::ProcessEvent(wxEvent&)
2373 wxEvtHandler::SearchDynamicEventTable(wxEvent&)
2373 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
2373 Parser::OnAllThreadsDone(CodeBlocksEvent&)
2373 Parser::ProcessParserEvent(ParsingType, int, wxString const&)
2373 wxEvtHandler::ProcessEvent(wxEvent&)
2373 wxEvtHandler::SearchDynamicEventTable(wxEvent&)
2373 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
2373 NativeParser::OnParserEnd(wxCommandEvent&)
2373 NativeParser::UpdateClassBrowser()
2373 ClassBrowser::UpdateView(bool)
2373 ClassBrowser::BuildTree()
2373 ClassBrowserBuilderThread::Init(NativeParser*, CBTreeCtrl*, CBTreeCtrl*, wxString const&, void*, BrowserOptions const&, TokensTree*, bool)
2373 wxMutexInternal::Lock()
2373 pthread_mutex_lock
2373 semaphore_wait_signal_trap
2373 Thread_50731 DispatchQueue_2: com.apple.libdispatch-manager (serial)
2373 start_wqthread
2373 _pthread_wqthread
2373 _dispatch_worker_thread2
2373 _dispatch_queue_invoke
2373 _dispatch_mgr_invoke
2373 kevent
2373 Thread_50733: com.apple.CFSocket.private
2373 thread_start
2373 _pthread_start
2373 __CFSocketManager
2373 select$DARWIN_EXTSN
2373 Thread_50737
2373 thread_start
2373 _pthread_start
2373 PrivateMPEntryPoint
2373 wxThreadInternal::MacThreadStart(void*)
2373 BackgroundThread::Entry()
2373 wxSemaphore::Wait()
2373 wxSemaphoreInternal::WaitTimeout(unsigned long)
2373 MPWaitOnSemaphore
2373 semaphore_timedwait_trap
2373 Thread_50738
2373 thread_start
2373 _pthread_start
2373 PrivateMPEntryPoint
2373 wxThreadInternal::MacThreadStart(void*)
2373 BackgroundThread::Entry()
2373 wxSemaphore::Wait()
2373 wxSemaphoreInternal::WaitTimeout(unsigned long)
2373 MPWaitOnSemaphore
2373 semaphore_timedwait_trap
2373 Thread_50739
2373 thread_start
2373 _pthread_start
2373 PrivateMPEntryPoint
2373 wxThreadInternal::MacThreadStart(void*)
2373 BackgroundThread::Entry()
2373 wxSemaphore::Wait()
2373 wxSemaphoreInternal::WaitTimeout(unsigned long)
2373 MPWaitOnSemaphore
2373 semaphore_timedwait_trap
2373 Thread_50740
2373 thread_start
2373 _pthread_start
2373 PrivateMPEntryPoint
2373 wxThreadInternal::MacThreadStart(void*)
2373 BackgroundThread::Entry()
2373 wxSemaphore::Wait()
2373 wxSemaphoreInternal::WaitTimeout(unsigned long)
2373 MPWaitOnSemaphore
2373 semaphore_timedwait_trap
2373 Thread_50754
2373 thread_start
2373 _pthread_start
2373 PrivateMPEntryPoint
2373 wxThreadInternal::MacThreadStart(void*)
2373 ClassBrowserBuilderThread::Entry()
2373 ClassBrowserBuilderThread::BuildTree()
2373 ClassBrowserBuilderThread::CollapseItem(wxTreeItemId)
2373 wxGenericTreeCtrl::CollapseAndReset(wxTreeItemId const&)
2373 wxGenericTreeCtrl::Collapse(wxTreeItemId const&)
2373 wxEvtHandler::ProcessEvent(wxEvent&)
2373 wxWindowBase::TryParent(wxEvent&)
2373 wxEvtHandler::ProcessEvent(wxEvent&)
2373 wxWindowBase::TryParent(wxEvent&)
2373 wxEvtHandler::ProcessEvent(wxEvent&)
2373 wxWindowBase::TryParent(wxEvent&)
2373 wxEvtHandler::ProcessEvent(wxEvent&)
2373 wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
2373 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
2373 ClassBrowser::OnTreeItemCollapsing(wxTreeEvent&)
2373 ClassBrowserBuilderThread::CollapseItem(wxTreeItemId)
2373 wxMutexInternal::Lock()
2373 pthread_mutex_lock
2373 semaphore_wait_signal_trap
2373 Thread_50817
2373 thread_start
2373 _pthread_start
2373 PrivateMPEntryPoint
2373 wxThreadInternal::MacThreadStart(void*)
2373 cbThreadPool::cbWorkerThread::Entry()
2373 wxSemaphore::Wait()
2373 wxSemaphoreInternal::WaitTimeout(unsigned long)
2373 MPWaitOnSemaphore
2373 semaphore_timedwait_trap
Total number in stack (recursive counted multiple, when >=5):
7 _pthread_start
7 thread_start
6 PrivateMPEntryPoint
6 wxEvtHandler::ProcessEvent(wxEvent&)
6 wxThreadInternal::MacThreadStart(void*)
5 MPWaitOnSemaphore
5 semaphore_timedwait_trap
5 wxSemaphore::Wait()
5 wxSemaphoreInternal::WaitTimeout(unsigned long)
Sort by top of stack, same collapsed (when >= 5):
semaphore_timedwait_trap 11865
semaphore_wait_signal_trap 4746
kevent 2373
select$DARWIN_EXTSN 2373
Edit >> code tags
Here is part of the crash report if it's of any help, might be a bit more informative then the call graph.
PID: 47621
Event: hang
Duration: 5.75s (sampling started after 2 seconds)
Steps: 17 (100ms sampling interval)
Pageins: 1
Pageouts: 0
Process: CodeBlocks [47621]
UID: 501
Thread d1a5 DispatchQueue 100
User stack:
17 start + 53 (in CodeBlocks) [0x9ef9]
17 main + 24 (in CodeBlocks) [0xa278]
17 wxEntry(int&, wchar_t**) + 160 (in libwx_macu-2.8.0.dylib) [0x7db880]
17 CodeBlocksApp::OnRun() + 32 (in CodeBlocks) [0xc050]
17 wxAppBase::MainLoop() + 83 (in libwx_macu-2.8.0.dylib) [0x8ebaa3]
17 wxEventLoopManual::Run() + 136 (in libwx_macu-2.8.0.dylib) [0x9128f8]
17 wxEventLoop::Dispatch() + 35 (in libwx_macu-2.8.0.dylib) [0x86cc13]
17 wxApp::MacDoOneEvent() + 123 (in libwx_macu-2.8.0.dylib) [0x85339b]
17 wxApp::MacHandleOneEvent(void*) + 50 (in libwx_macu-2.8.0.dylib) [0x852b72]
17 wxMacProcessNotifierAndPendingEvents + 34 (in libwx_macu-2.8.0.dylib) [0x825952]
17 wxAppConsole::ProcessPendingEvents() + 105 (in libwx_macu-2.8.0.dylib) [0x7a3b59]
17 wxEvtHandler::ProcessPendingEvents() + 123 (in libwx_macu-2.8.0.dylib) [0x82ed0b]
17 wxEvtHandler::ProcessEvent(wxEvent&) + 179 (in libwx_macu-2.8.0.dylib) [0x82eeb3]
17 wxEvtHandler::SearchDynamicEventTable(wxEvent&) + 86 (in libwx_macu-2.8.0.dylib) [0x82d766]
17 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) + 131 (in libwx_macu-2.8.0.dylib) [0x82d6a3]
17 Parser::OnAllThreadsDone(CodeBlocksEvent&) + 848 (in libcodecompletion.so) [0x17f78040]
17 Parser::ProcessParserEvent(ParsingType, int, wxString const&) + 108 (in libcodecompletion.so) [0x17f72ebc]
17 wxEvtHandler::ProcessEvent(wxEvent&) + 179 (in libwx_macu-2.8.0.dylib) [0x82eeb3]
17 wxEvtHandler::SearchDynamicEventTable(wxEvent&) + 86 (in libwx_macu-2.8.0.dylib) [0x82d766]
17 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) + 131 (in libwx_macu-2.8.0.dylib) [0x82d6a3]
17 NativeParser::OnParserEnd(wxCommandEvent&) + 187 (in libcodecompletion.so) [0x17f6293b]
17 NativeParser::UpdateClassBrowser() + 344 (in libcodecompletion.so) [0x17f5f6b8]
17 ClassBrowser::UpdateView(bool) + 840 (in libcodecompletion.so) [0x17f1c958]
17 ClassBrowser::BuildTree() + 128 (in libcodecompletion.so) [0x17f1be80]
17 ClassBrowserBuilderThread::Init(NativeParser*, CBTreeCtrl*, CBTreeCtrl*, wxString const&, void*, BrowserOptions const&, TokensTree*, bool) + 57 (in libcodecompletion.so) [0x17f264e9]
17 wxMutexInternal::Lock() + 17 (in libwx_macu-2.8.0.dylib) [0x824431]
17 semaphore_wait_trap + 10 (in libSystem.B.dylib) [0x919d8b36]
Kernel stack:
17 semaphore_wait_continue + 0 [0x22a88f]
Thread d1b0 DispatchQueue 1634545000
User stack:
17 start_wqthread + 30 (in libSystem.B.dylib) [0x919fe5c6]
17 _pthread_wqthread + 390 (in libSystem.B.dylib) [0x919fe781]
17 _dispatch_worker_thread2 + 240 (in libSystem.B.dylib) [0x919fecfe]
17 _dispatch_queue_invoke + 163 (in libSystem.B.dylib) [0x919fef59]
17 kevent + 10 (in libSystem.B.dylib) [0x919ff382]
Kernel stack:
17 kevent + 97 [0x47a699]
Thread d1b3
User stack:
17 thread_start + 34 (in libSystem.B.dylib) [0x91a060de]
17 _pthread_start + 345 (in libSystem.B.dylib) [0x91a06259]
17 select$DARWIN_EXTSN + 10 (in libSystem.B.dylib) [0x919f7ac6]
Kernel stack:
17 sleep + 52 [0x49115a]
Thread d1b8
User stack:
17 thread_start + 34 (in libSystem.B.dylib) [0x91a060de]
17 _pthread_start + 345 (in libSystem.B.dylib) [0x91a06259]
17 PrivateMPEntryPoint + 68 (in CarbonCore) [0x960c954a]
17 wxThreadInternal::MacThreadStart(void*) + 96 (in libwx_macu-2.8.0.dylib) [0x825130]
17 BackgroundThread::Entry() + 30 (in libcodeblocks.0.dylib) [0x19bece]
17 wxSemaphore::Wait() + 36 (in libwx_macu-2.8.0.dylib) [0x824194]
17 wxSemaphoreInternal::WaitTimeout(unsigned long) + 27 (in libwx_macu-2.8.0.dylib) [0x8240db]
17 semaphore_timedwait_trap + 10 (in libSystem.B.dylib) [0x919d8b4e]
Kernel stack:
17 semaphore_wait_continue + 0 [0x22a88f]
Thread d1b9
User stack:
17 thread_start + 34 (in libSystem.B.dylib) [0x91a060de]
17 _pthread_start + 345 (in libSystem.B.dylib) [0x91a06259]
17 PrivateMPEntryPoint + 68 (in CarbonCore) [0x960c954a]
17 wxThreadInternal::MacThreadStart(void*) + 96 (in libwx_macu-2.8.0.dylib) [0x825130]
17 BackgroundThread::Entry() + 30 (in libcodeblocks.0.dylib) [0x19bece]
17 wxSemaphore::Wait() + 36 (in libwx_macu-2.8.0.dylib) [0x824194]
17 wxSemaphoreInternal::WaitTimeout(unsigned long) + 27 (in libwx_macu-2.8.0.dylib) [0x8240db]
17 semaphore_timedwait_trap + 10 (in libSystem.B.dylib) [0x919d8b4e]
Kernel stack:
17 semaphore_wait_continue + 0 [0x22a88f]
Thread d1ba
User stack:
17 thread_start + 34 (in libSystem.B.dylib) [0x91a060de]
17 _pthread_start + 345 (in libSystem.B.dylib) [0x91a06259]
17 PrivateMPEntryPoint + 68 (in CarbonCore) [0x960c954a]
17 wxThreadInternal::MacThreadStart(void*) + 96 (in libwx_macu-2.8.0.dylib) [0x825130]
17 BackgroundThread::Entry() + 30 (in libcodeblocks.0.dylib) [0x19bece]
17 wxSemaphore::Wait() + 36 (in libwx_macu-2.8.0.dylib) [0x824194]
17 wxSemaphoreInternal::WaitTimeout(unsigned long) + 27 (in libwx_macu-2.8.0.dylib) [0x8240db]
17 semaphore_timedwait_trap + 10 (in libSystem.B.dylib) [0x919d8b4e]
Kernel stack:
17 semaphore_wait_continue + 0 [0x22a88f]
Thread d1bb
User stack:
17 thread_start + 34 (in libSystem.B.dylib) [0x91a060de]
17 _pthread_start + 345 (in libSystem.B.dylib) [0x91a06259]
17 PrivateMPEntryPoint + 68 (in CarbonCore) [0x960c954a]
17 wxThreadInternal::MacThreadStart(void*) + 96 (in libwx_macu-2.8.0.dylib) [0x825130]
17 BackgroundThread::Entry() + 30 (in libcodeblocks.0.dylib) [0x19bece]
17 wxSemaphore::Wait() + 36 (in libwx_macu-2.8.0.dylib) [0x824194]
17 wxSemaphoreInternal::WaitTimeout(unsigned long) + 27 (in libwx_macu-2.8.0.dylib) [0x8240db]
17 semaphore_timedwait_trap + 10 (in libSystem.B.dylib) [0x919d8b4e]
Kernel stack:
17 semaphore_wait_continue + 0 [0x22a88f]
Thread d1c3
User stack:
17 thread_start + 34 (in libSystem.B.dylib) [0x91a060de]
17 _pthread_start + 345 (in libSystem.B.dylib) [0x91a06259]
17 PrivateMPEntryPoint + 68 (in CarbonCore) [0x960c954a]
17 wxThreadInternal::MacThreadStart(void*) + 96 (in libwx_macu-2.8.0.dylib) [0x825130]
17 ClassBrowserBuilderThread::Entry() + 65 (in libcodecompletion.so) [0x17f258d1]
17 ClassBrowserBuilderThread::BuildTree() + 862 (in libcodecompletion.so) [0x17f256ce]
17 ClassBrowserBuilderThread::CollapseItem(wxTreeItemId) + 92 (in libcodecompletion.so) [0x17f21bbc]
17 wxGenericTreeCtrl::CollapseAndReset(wxTreeItemId const&) + 33 (in libwx_macu-2.8.0.dylib) [0x99a8e1]
17 wxGenericTreeCtrl::Collapse(wxTreeItemId const&) + 128 (in libwx_macu-2.8.0.dylib) [0x9a1ab0]
17 wxEvtHandler::ProcessEvent(wxEvent&) + 121 (in libwx_macu-2.8.0.dylib) [0x82ee79]
17 wxWindowBase::TryParent(wxEvent&) + 88 (in libwx_macu-2.8.0.dylib) [0x969348]
17 wxEvtHandler::ProcessEvent(wxEvent&) + 121 (in libwx_macu-2.8.0.dylib) [0x82ee79]
17 wxWindowBase::TryParent(wxEvent&) + 88 (in libwx_macu-2.8.0.dylib) [0x969348]
17 wxEvtHandler::ProcessEvent(wxEvent&) + 121 (in libwx_macu-2.8.0.dylib) [0x82ee79]
17 wxWindowBase::TryParent(wxEvent&) + 88 (in libwx_macu-2.8.0.dylib) [0x969348]
17 wxEvtHandler::ProcessEvent(wxEvent&) + 207 (in libwx_macu-2.8.0.dylib) [0x82eecf]
17 wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) + 113 (in libwx_macu-2.8.0.dylib) [0x82e9b1]
17 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) + 131 (in libwx_macu-2.8.0.dylib) [0x82d6a3]
17 ClassBrowser::OnTreeItemCollapsing(wxTreeEvent&) + 41 (in libcodecompletion.so) [0x17f1c069]
17 ClassBrowserBuilderThread::CollapseItem(wxTreeItemId) + 71 (in libcodecompletion.so) [0x17f21ba7]
17 wxMutexInternal::Lock() + 17 (in libwx_macu-2.8.0.dylib) [0x824431]
17 semaphore_wait_signal_trap + 10 (in libSystem.B.dylib) [0x919d8b42]
Kernel stack:
17 semaphore_wait_continue + 0 [0x22a88f]
Thread d23f
User stack:
17 thread_start + 34 (in libSystem.B.dylib) [0x91a060de]
17 _pthread_start + 345 (in libSystem.B.dylib) [0x91a06259]
17 PrivateMPEntryPoint + 68 (in CarbonCore) [0x960c954a]
17 wxThreadInternal::MacThreadStart(void*) + 96 (in libwx_macu-2.8.0.dylib) [0x825130]
17 cbThreadPool::cbWorkerThread::Entry() + 122 (in libcodeblocks.0.dylib) [0x12478a]
17 wxSemaphore::Wait() + 36 (in libwx_macu-2.8.0.dylib) [0x824194]
17 wxSemaphoreInternal::WaitTimeout(unsigned long) + 27 (in libwx_macu-2.8.0.dylib) [0x8240db]
17 semaphore_timedwait_trap + 10 (in libSystem.B.dylib) [0x919d8b4e]
Kernel stack:
17 semaphore_wait_continue + 0 [0x22a88f]
In cbEditor.h, see a function prototype:
/** Move the caret at the specified line.
* @param line Line to move caret to.
* @param centerOnScreen If true (default), tries to bring the specified line to the centre of the editor.*/
void GotoLine(int line, bool centerOnScreen = true);
So, it should be quite easy to implement this feature.
About the other feature, put the focus on the editor window, probably it is easy too.
A simple patch to implement both features:
Index: E:/code/cb/cb_trunk/src/plugins/codecompletion/codecompletion.cpp
===================================================================
--- E:/code/cb/cb_trunk/src/plugins/codecompletion/codecompletion.cpp (revision 7460)
+++ E:/code/cb/cb_trunk/src/plugins/codecompletion/codecompletion.cpp (working copy)
@@ -416,7 +416,9 @@
if (line > control->GetLineCount())
return false;
- control->GotoLine(line);
+ //control->GotoLine(line);
+ editor->GotoLine(line,true);
+ editor->SetFocus();
const int startPos = control->GetCurrentPos();
const int endPos = startPos + control->LineLength(line);
if (endPos <= startPos)
I do not know if it first occurred in this version, but should not the linker option -enable-auto-import in the Windows NassiShneiderman plugin be -Wl,-enable-auto-import instead?
Index: src/plugins/contrib/NassiShneiderman/NassiShneiderman.cbp
===================================================================
--- src/plugins/contrib/NassiShneiderman/NassiShneiderman.cbp (revision 7479)
+++ src/plugins/contrib/NassiShneiderman/NassiShneiderman.cbp (working copy)
@@ -37,7 +37,7 @@
<Add directory="$(#boost)" />
</Compiler>
<Linker>
- <Add option="-enable-auto-import" />
+ <Add option="-Wl,-enable-auto-import" />
<Add library="codeblocks" />
<Add library="wxmsw$(WX_VERSION)$(WX_SUFFIX)" />
<Add directory="..\..\..\devel" />
I hope this is the right place for it... sorry if it is not.
Maybe it's a known issue (I could not find something like that in previous posts), but "Find declaration" and "Find implementation" does not work correctly with this code (you can try it in a new project):
int foo()
{
return 0;
}
void bar(void)
{
foo(); // declaration and implementation are found correctly
switch(0)
{
case 0:
return foo(); // IT DOES NOT WORK while searching foo() declaration or implementation
}
}
OS: Win Vista
This patch should fix the parser problem:
Index: F:/cb/codeblocks_trunk/src/plugins/codecompletion/parser/parserthread.cpp
===================================================================
--- F:/cb/codeblocks_trunk/src/plugins/codecompletion/parser/parserthread.cpp (revision 7496)
+++ F:/cb/codeblocks_trunk/src/plugins/codecompletion/parser/parserthread.cpp (working copy)
@@ -131,6 +131,7 @@
const wxString kw_else (_T("else"));
const wxString kw_enum (_T("enum"));
const wxString kw_elif (_T("elif"));
+ const wxString kw_case (_T("case"));
// length: 5
const wxString kw__CPP_ (_T("\"C++\""));
const wxString kw___asm (_T("__asm"));
@@ -688,6 +689,11 @@
else
SkipToOneOfChars(ParserConsts::semicolonclbrace, true);
}
+ else if (token == ParserConsts::kw_case)
+ {
+ m_Str.Clear();
+ SkipToOneOfChars(ParserConsts::colon, true);
+ }
else
switchHandled = false;
break;
I just put it in my pending patches lists (http://wiki.codeblocks.org/index.php?title=User:Ollydbg).