Patch #2458 2008-05-07 19:14

typz

Custom GDB commands (run, continue...) for remote debugging
Download
2458-Custom_GDB_com.patch (16.0 KB)
Category
Plugin::FeatureAdd
Status
Open
Close date
 
Assigned to
 
Index: plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- plugins/debuggergdb/debuggergdb.cpp    (revision 5035)
+++ plugins/debuggergdb/debuggergdb.cpp    (working copy)
@@ -697,6 +697,17 @@
                     if (rdOpt->Attribute("skip_ld_path"))
                         rd.skipLDpath = cbC2U(rdOpt->Attribute("skip_ld_path")) != _T("0");
 
+                    if (rdOpt->Attribute("runCmd"))
+                        rd.runCmd = cbC2U(rdOpt->Attribute("runCmd"));
+                    if (rdOpt->Attribute("continueCmd"))
+                        rd.continueCmd = cbC2U(rdOpt->Attribute("continueCmd"));
+                    if (rdOpt->Attribute("stopCmd"))
+                        rd.stopCmd = cbC2U(rdOpt->Attribute("stopCmd"));
+                    if (rdOpt->Attribute("listThreadCmd"))
+                        rd.listThreadCmd = cbC2U(rdOpt->Attribute("listThreadCmd"));
+                    if (rdOpt->Attribute("switchThreadCmd"))
+                        rd.switchThreadCmd = cbC2U(rdOpt->Attribute("switchThreadCmd"));
+
                     rdprj.insert(rdprj.end(), std::make_pair(bt, rd));
                 }
                 else
@@ -766,6 +777,17 @@
                     tgtnode->SetAttribute("additional_cmds_before", cbU2C(rd.additionalCmdsBefore));
                 if (rd.skipLDpath)
                     tgtnode->SetAttribute("skip_ld_path", "1");
+
+                if (!rd.runCmd.IsEmpty())
+                    tgtnode->SetAttribute("runCmd", cbU2C(rd.runCmd));
+                if (!rd.continueCmd.IsEmpty())
+                    tgtnode->SetAttribute("continueCmd", cbU2C(rd.continueCmd));
+                if (!rd.stopCmd.IsEmpty())
+                    tgtnode->SetAttribute("stopCmd", cbU2C(rd.stopCmd));
+                if (!rd.listThreadCmd.IsEmpty())
+                    tgtnode->SetAttribute("listThreadCmd", cbU2C(rd.listThreadCmd));
+                if (!rd.switchThreadCmd.IsEmpty())
+                    tgtnode->SetAttribute("switchThreadCmd", cbU2C(rd.switchThreadCmd));
             }
         }
     }
Index: plugins/debuggergdb/debuggeroptionsprjdlg.cpp
===================================================================
--- plugins/debuggergdb/debuggeroptionsprjdlg.cpp    (revision 5035)
+++ plugins/debuggergdb/debuggeroptionsprjdlg.cpp    (working copy)
@@ -78,6 +78,12 @@
         XRCCTRL(*this, "txtCmds", wxTextCtrl)->SetValue(rd.additionalCmds);
         XRCCTRL(*this, "txtCmdsBefore", wxTextCtrl)->SetValue(rd.additionalCmdsBefore);
         XRCCTRL(*this, "chkSkipLDpath", wxCheckBox)->SetValue(rd.skipLDpath);
+
+        XRCCTRL(*this, "txtDebugCmd", wxTextCtrl)->SetValue(rd.runCmd);
+        XRCCTRL(*this, "txtContinueCmd", wxTextCtrl)->SetValue(rd.continueCmd);
+        XRCCTRL(*this, "txtStopCmd", wxTextCtrl)->SetValue(rd.stopCmd);
+        XRCCTRL(*this, "txtListThreadsCmd", wxTextCtrl)->SetValue(rd.listThreadCmd);
+        XRCCTRL(*this, "txtSwitchThreadCmd", wxTextCtrl)->SetValue(rd.switchThreadCmd);
     }
     else
     {
@@ -89,6 +95,12 @@
         XRCCTRL(*this, "txtCmds", wxTextCtrl)->SetValue(wxEmptyString);
         XRCCTRL(*this, "txtCmdsBefore", wxTextCtrl)->SetValue(wxEmptyString);
         XRCCTRL(*this, "chkSkipLDpath", wxCheckBox)->SetValue(false);
+
+        XRCCTRL(*this, "txtDebugCmd", wxTextCtrl)->SetValue(wxEmptyString);
+        XRCCTRL(*this, "txtContinueCmd", wxTextCtrl)->SetValue(wxEmptyString);
+        XRCCTRL(*this, "txtStopCmd", wxTextCtrl)->SetValue(wxEmptyString);
+        XRCCTRL(*this, "txtListThreadsCmd", wxTextCtrl)->SetValue(wxEmptyString);
+        XRCCTRL(*this, "txtSwitchThreadCmd", wxTextCtrl)->SetValue(wxEmptyString);
     }
 }
 
@@ -115,6 +127,12 @@
     rd.additionalCmds = XRCCTRL(*this, "txtCmds", wxTextCtrl)->GetValue();
     rd.additionalCmdsBefore = XRCCTRL(*this, "txtCmdsBefore", wxTextCtrl)->GetValue();
     rd.skipLDpath = XRCCTRL(*this, "chkSkipLDpath", wxCheckBox)->GetValue();
+
+    rd.runCmd = XRCCTRL(*this, "txtDebugCmd", wxTextCtrl)->GetValue();
+    rd.continueCmd = XRCCTRL(*this, "txtContinueCmd", wxTextCtrl)->GetValue();
+    rd.stopCmd = XRCCTRL(*this, "txtStopCmd", wxTextCtrl)->GetValue();
+    rd.listThreadCmd = XRCCTRL(*this, "txtListThreadsCmd", wxTextCtrl)->GetValue();
+    rd.switchThreadCmd = XRCCTRL(*this, "txtSwitchThreadCmd", wxTextCtrl)->GetValue();
 }
 
 void DebuggerOptionsProjectDlg::OnTargetSel(wxCommandEvent& event)
@@ -189,6 +207,12 @@
     XRCCTRL(*this, "txtCmds", wxTextCtrl)->Enable(en);
     XRCCTRL(*this, "txtCmdsBefore", wxTextCtrl)->Enable(en);
     XRCCTRL(*this, "chkSkipLDpath", wxCheckBox)->Enable(en);
+
+    XRCCTRL(*this, "txtDebugCmd", wxTextCtrl)->Enable(en);
+    XRCCTRL(*this, "txtContinueCmd", wxTextCtrl)->Enable(en);
+    XRCCTRL(*this, "txtStopCmd", wxTextCtrl)->Enable(en);
+    XRCCTRL(*this, "txtListThreadsCmd", wxTextCtrl)->Enable(en);
+    XRCCTRL(*this, "txtSwitchThreadCmd", wxTextCtrl)->Enable(en);
 }
 
 void DebuggerOptionsProjec
download for full patch...