Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

clangd_client string name inside the codecompletion\parser\cclogger.cpp file

(1/3) > >>

ollydbg:
Hi, Pecan, I see this changes in revision 13432


--- Code: --- // Initialized from CodeCompletion constructor
-void CCLogger::Init(wxEvtHandler* parent, int logId, int debugLogId, int addTokenId)
+// ----------------------------------------------------------------------------
+//-void CCLogger::Init(wxEvtHandler* parent, int logId, int debugLogId, int debugLogErrorId, int addTokenId)
+void CCLogger::Init(wxEvtHandler* parent, int logId, int logErrorId, int debugLogId, int debugLogErrorId, int addTokenId)
+// ----------------------------------------------------------------------------
 {
     m_Parent     = parent;
     m_LogId      = logId;
     m_DebugLogId = debugLogId;
+    m_DebugLogErrorId = debugLogErrorId;
     m_AddTokenId = addTokenId;
+    m_AddTokenId = addTokenId;
+    m_pCfgMgr    = Manager::Get()->GetConfigManager("clangd_client");
+
 }

--- End code ---

When I try to run the CCTest program, I got an assert failed:


--- Code: ---const wxString PersonalityManager::GetPersonality()
{
    cbAssert(m_ready);
    return m_pers;
}

--- End code ---

The issue is that CCTest program has dynamically link to the codeblocks.dll(maybe I need to remove it, but it would be hard such dependency).

So I believe either CCTest code need to initialize some *Manager instance, or the code in the cclogger need to be changed.

But why the "clangd_client" name is in this function call?

Thanks.


EDIT:


--- Code: ---m_AddTokenId = addTokenId;

--- End code ---

This line is duplicated.



ollydbg:
If I remove the line:


--- Code: ---diff --git a/src/plugins/codecompletion/parser/cclogger.cpp b/src/plugins/codecompletion/parser/cclogger.cpp
index 65e9d905..31c9d034 100644
--- a/src/plugins/codecompletion/parser/cclogger.cpp
+++ b/src/plugins/codecompletion/parser/cclogger.cpp
@@ -76,7 +76,7 @@ void CCLogger::Init(wxEvtHandler* parent, int logId, int logErrorId, int debugLo
     m_DebugLogErrorId = debugLogErrorId;
     m_AddTokenId = addTokenId;
     m_AddTokenId = addTokenId;
-    m_pCfgMgr    = Manager::Get()->GetConfigManager("clangd_client");
+    //m_pCfgMgr    = Manager::Get()->GetConfigManager("clangd_client");
 
 }
 


--- End code ---

Then I can run the CCTest. Though the CCTest's frame window can be opened, I still can't see the debug log messages in the windows, so there are other issues.

ollydbg:
OK, I found a workaround:


--- Code: ---diff --git a/src/plugins/codecompletion/cctest/cctest_frame.cpp b/src/plugins/codecompletion/cctest/cctest_frame.cpp
index 32ab3cd0..30fa8ff6 100644
--- a/src/plugins/codecompletion/cctest/cctest_frame.cpp
+++ b/src/plugins/codecompletion/cctest/cctest_frame.cpp
@@ -20,6 +20,8 @@
 
 #include "parsemanager_test.h"
 
+#include "personalitymanager.h"
+
 //(*InternalHeaders(CCTestFrame)
 #include <wx/intl.h>
 #include <wx/settings.h>
@@ -215,6 +217,8 @@ CCTestFrame::CCTestFrame(const wxString& main_file) :
     Connect(wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction)&CCTestFrame::OnMenuAboutSelected);
     //*)
 
+    Manager::Get()->GetPersonalityManager()->MarkAsReady();
+
     // redirect the wxLogMessage to the text ctrl of the frame
     wxLogTextCtrl* textLog = new wxLogTextCtrl(m_CompletionTestCtrl);
     wxLog::SetActiveTarget(textLog);

--- End code ---

Pecan:
@ ollydbg

Thanks for finding a work around.
I'll pay attention to it as soon as I can.

For now, my whole day is spent trying to find a work around for the playWX.cpp crash when using Ubuntu and gtk 3.2 .
I'm getting close.

ollydbg:

--- Quote from: Pecan on February 21, 2024, 07:19:38 pm ---@ ollydbg

Thanks for finding a work around.
I'll pay attention to it as soon as I can.

--- End quote ---

OK, thanks.


--- Quote ---For now, my whole day is spent trying to find a work around for the playWX.cpp crash when using Ubuntu and gtk 3.2 .
I'm getting close.

--- End quote ---

I see you have committed a fix in the trunk. In-fact, the scintilla and its wxWidgets port are very complex, and I had no idea about the crash issue. Maybe, the gtk 3.2 has changed the event send sequence, maybe we need to migrate to a more modern wx port of scintilla. (I think we have maintain an old scintilla)

Navigation

[0] Message Index

[#] Next page

Go to full version