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

Splitting debugger in two - specific debugger and common GUI

<< < (13/136) > >>

MortenMacFly:
...just for the record: Everything compiles fine and seems to run fine on Windows XP. However - on Vista I get an immediate crash which has it's source in wxPropGrid. Not sure if it's a wxPropGrid bug or C::B...

oBFusCATed:
No Vista around to test it :(
Can you post the backtrace?

By the way I've found, some little bugs... will provide patch at some point :)

Another thing, what is the master plan for the application of the patch?
Test it some more and put it in trunk or a separate branch?
Or it depends on the wxpropgrid's integration in C::B's tree?

MortenMacFly:

--- Quote from: oBFusCATed on September 12, 2009, 08:30:45 pm ---Test it some more and put it in trunk or a separate branch?
Or it depends on the wxpropgrid's integration in C::B's tree?

--- End quote ---
We have discussed that already internally.
My proposal:
1.) integrate wxpropgrid into trunk
2.) Apply patches (already available and currently in testing phase) to update all components to new wxpropertygrid
3.) remove old one from wxsmith (to avoid conflicts)
4.) (in parallel) -> create a branch to test the new debugger stuff
5.) (if all devs agree) -> merge into trunk.

MortenMacFly:

--- Quote from: oBFusCATed on September 12, 2009, 08:30:45 pm ---Can you post the backtrace?

--- End quote ---
The backtrace has only addresses, no source code. I did some mods already myself. Keep posting patches quickly to avoid conflicts, please. ;-) I'll post a screenshot of the debugger session once I am ready. I seem to be a null pointer access at initialisation phase of wxproptertygrid...

oBFusCATed:
Patch 1 - RunToCursor goes to the correct line

--- Code: ---index e6a1e9a..475ae23 100644
--- a/src/sdk/debuggermenu.cpp
+++ b/src/sdk/debuggermenu.cpp
@@ -233,7 +233,7 @@ void DebuggerMenuHandler::OnRunToCursor(wxCommandEvent& event)
     if (!ed)
         return;
     const wxString &line_text = ed->GetControl()->GetLine(ed->GetControl()->GetCurrentLine());
-    m_activeDebugger->RunToCursor(ed->GetFilename(), ed->GetControl()->GetCurrentLine(), line_text);
+    m_activeDebugger->RunToCursor(ed->GetFilename(), ed->GetControl()->GetCurrentLine() + 1, line_text);
 }
 
 void DebuggerMenuHandler::OnToggleBreakpoint(wxCommandEvent& event)


--- End code ---

Patch 2 - make writing debugger plugins easier

--- Code: ---diff --git a/src/include/cbplugin.h b/src/include/cbplugin.h
index 6f234ea..7237c07 100644
--- a/src/include/cbplugin.h
+++ b/src/include/cbplugin.h
@@ -498,6 +498,7 @@ class PLUGIN_EXPORT cbDebuggerPlugin: public cbPlugin
         virtual wxString GetEditorWordAtCaret();
     protected:
         void RemoveBreakpointFromEditor(const wxString& filename, int line);
+        void ClearActiveMarkFromAllEditors();
     private:
         wxToolBar *m_toolbar;
 };
diff --git a/src/plugins/debuggergdb/debuggergdb.cpp b/src/plugins/debuggergdb/debuggergdb.cpp
index 9b8c36d..9e34854 100644
--- a/src/plugins/debuggergdb/debuggergdb.cpp
+++ b/src/plugins/debuggergdb/debuggergdb.cpp
@@ -1774,20 +1774,6 @@ void DebuggerGDB::BringAppToFront()
         app->Raise();
 }
 
-void DebuggerGDB::ClearActiveMarkFromAllEditors()
-{
-    EditorManager* edMan = Manager::Get()->GetEditorManager();
-//  Plugins are destroyed prior to EditorManager, so this is guaranteed to be valid at all times
-//    if (!edMan)
-//        return;
-    for (int i = 0; i < edMan->GetEditorsCount(); ++i)
-    {
-        cbEditor* ed = edMan->GetBuiltinEditor(i);
-        if (ed)
-            ed->SetDebugLine(-1);
-    }
-}
-
 void DebuggerGDB::SyncEditor(const wxString& filename, int line, bool setMarker)
 {
     DebuggerManager::SyncEditorResult result;
diff --git a/src/plugins/debuggergdb/debuggergdb.h b/src/plugins/debuggergdb/debuggergdb.h
index 72703a9..ea9fa3f 100644
--- a/src/plugins/debuggergdb/debuggergdb.h
+++ b/src/plugins/debuggergdb/debuggergdb.h
@@ -116,7 +116,6 @@ class DebuggerGDB : public cbDebuggerPlugin
         void DoSwitchToDebuggingLayout();
         void DoSwitchToPreviousLayout();
         void ParseOutput(const wxString& output);
-        void ClearActiveMarkFromAllEditors();
         void DoWatches();
         wxString FindDebuggerExecutable(Compiler* compiler);
         int LaunchProcess(const wxString& cmd, const wxString& cwd);
diff --git a/src/sdk/cbplugin.cpp b/src/sdk/cbplugin.cpp
index 4f6a2e1..0650ea5 100644
--- a/src/sdk/cbplugin.cpp
+++ b/src/sdk/cbplugin.cpp
@@ -166,6 +166,20 @@ void cbDebuggerPlugin::RemoveBreakpointFromEditor(const wxString& filename, int
         ed->RemoveBreakpoint(line, false);
 }
 
+void cbDebuggerPlugin::ClearActiveMarkFromAllEditors()
+{
+    EditorManager* edMan = Manager::Get()->GetEditorManager();
+//  Plugins are destroyed prior to EditorManager, so this is guaranteed to be valid at all times
+//    if (!edMan)
+//        return;
+    for (int i = 0; i < edMan->GetEditorsCount(); ++i)
+    {
+        cbEditor* ed = edMan->GetBuiltinEditor(i);
+        if (ed)
+            ed->SetDebugLine(-1);
+    }
+}
+
 /////
 ///// cbToolPlugin
 /////


--- End code ---

Patch 3 - the stop button behaviour has been broken  :roll:

--- Code: ------ a/src/sdk/debuggermenu.cpp
+++ b/src/sdk/debuggermenu.cpp
@@ -190,7 +190,10 @@ void DebuggerMenuHandler::OnStart(wxCommandEvent& event)
 void DebuggerMenuHandler::OnStop(wxCommandEvent& event)
 {
     cbAssert(m_activeDebugger);
-    m_activeDebugger->Stop();
+    if(m_activeDebugger->IsStopped())
+        m_activeDebugger->Stop();
+    else
+        m_activeDebugger->Break();
 }
 
 void DebuggerMenuHandler::OnContinue(wxCommandEvent& event)

--- End code ---

What are you changes?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version