Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Splitting debugger in two - specific debugger and common GUI

<< < (12/136) > >>

oBFusCATed:

--- Quote from: MortenMacFly on September 10, 2009, 06:07:40 pm ---It was not that one but enabling the debugger's debug log (in the debuggers options).

--- End quote ---

Crashed it too, will debug in a minute

Update: THE PATCH:


--- Code: ---diff U3 include/logmanager.h include/logmanager.h
--- include/logmanager.h Thu Jan 15 11:14:12 1970
+++ include/logmanager.h Thu Jan 15 11:14:12 1970
@@ -100,7 +100,7 @@
          *     Plugins should call Panic() with the plugin's name as the component argument.
          */
 
- void Log(const wxString& msg, int i = app_log, Logger::level lv = Logger::info) { slot[i].log->Append(msg, lv); };
+ void Log(const wxString& msg, int i = app_log, Logger::level lv = Logger::info) { cbAssert(i >= 0 && i <= max_logs); slot[i].log->Append(msg, lv); };
  void LogWarning(const wxString& msg, int i = app_log) { Log(msg, i, Logger::warning); };
  void LogError(const wxString& msg, int i = app_log) { Log(msg, i, Logger::error); };
 
diff U3 plugins/debuggergdb/debuggergdb.cpp plugins/debuggergdb/debuggergdb.cpp
--- plugins/debuggergdb/debuggergdb.cpp Thu Jan 15 11:14:12 1970
+++ plugins/debuggergdb/debuggergdb.cpp Thu Jan 15 11:14:12 1970
@@ -340,11 +340,11 @@
     if (!log_visible && m_HasDebugLog)
     {
         Manager::Get()->GetDebuggerManager()->HideLogger(true);
+        m_DbgPageIndex = -1;
     }
     else if (log_visible && !m_HasDebugLog)
     {
-        int index;
-        Manager::Get()->GetDebuggerManager()->GetLogger(true, index);
+        Manager::Get()->GetDebuggerManager()->GetLogger(true, m_DbgPageIndex);
     }
     m_HasDebugLog = log_visible;
 }

--- End code ---

oBFusCATed:
With the patch above, I get this error on linux:

--- Code: ---/home/obfuscated/projects/codeblocks/git/src/include/logmanager.h:103: warning: comparison between signed and unsigned integer expressions
/home/obfuscated/projects/codeblocks/git/src/include/logmanager.h:103: error: ‘cbAssert’ was not declared in this scope

--- End code ---
Which is the best way I can fix it?

Update: the error is in my plugin which is outside of the CB tree

MortenMacFly:

--- Quote from: oBFusCATed on September 10, 2009, 08:38:31 pm ---Which is the best way I can fix it?

--- End quote ---
I've attached a modified logmanager.h which I will check-in later. Please use that instead of cbAssert in that case. Cause otherwise badly written plugins will terminate C::B.

[attachment deleted by admin]

oBFusCATed:
Morten are you sure?
I think that cbAssert does nothing in release builds?
If we have a definition of release builds :)

MortenMacFly:

--- Quote from: oBFusCATed on September 10, 2009, 09:27:58 pm ---I think that cbAssert does nothing in release builds?

--- End quote ---
That's true. However - as we rarely doing true debug builds we would not see it anyways...

BTW: Your error: You'll need to include cbexcepton.h in logmanager.h.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version