When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.
What patch? Link?
void DebuggerTree::OnLoadWatchFile(wxCommandEvent& event){ WatchesArray fromFile = m_Watches; // copy current watches // ToDo: // - Currently each watch is imported as WatchType "Unspecified". This should // be changed that the file contains another (optional) column with the type. // - Change "Watch files" format to XML? // - With the current implementation sometimes the debugger tree gets weird. // - (Maybe) verify that watches are not already present? wxString fname; wxFileDialog dlg (Manager::Get()->GetAppWindow(), _T("Load debugger watch file"), _T(""), _T(""), _T("Watch files (*.watch)|*.watch|Any file (*)|*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR | compatibility::wxHideReadonly); PlaceWindow(&dlg); if (dlg.ShowModal() != wxID_OK) return; wxTextFile tf(dlg.GetPath()); if (tf.Open()) { // iterate over each line of file and send to debugger wxString cmd = tf.GetFirstLine(); while(true) { if (!cmd.IsEmpty()) // Skip empty lines {// Manager::Get()->GetLogManager()->DebugLog(_T("Adding watch \"%s\" to debugger:"), keyword); AddWatch(cmd, Undefined, false); // do not notify about new watch (we 'll do it when done) } if (tf.Eof()) break; cmd = tf.GetNextLine(); } tf.Close(); // release file handle // notify about changed watches NotifyForChangedWatches(); } else Manager::Get()->GetLogManager()->DebugLog(_T("Error opening debugger watch file: ") + fname);}void DebuggerTree::OnSaveWatchFile(wxCommandEvent& event){ // Verify that there ARE watches to save size_t wc = m_Watches.GetCount(); if (wc<1) { cbMessageBox(_("There are no watches in the list to save."), _("Save Watches"), wxICON_ERROR); return; } wxString fname; wxFileDialog dlg (Manager::Get()->GetAppWindow(), _T("Save debugger watch file"), _T(""), _T(""), _T("Watch files (*.watch)|*.watch|Any file (*)|*"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); PlaceWindow(&dlg); if (dlg.ShowModal() != wxID_OK) return; wxTextFile tf(dlg.GetPath()); bool bSuccess = false; // Create() will fail if the file exist -> must use Open() if file exist if (tf.Exists()) { bSuccess = tf.Open(); if (bSuccess) tf.Clear(); // remove old content (if any) } else bSuccess = tf.Create(); if (bSuccess) { // iterate over each watch and write them to the file buffer for (size_t i = 0; i < wc; ++i) { Watch& w = m_Watches[i]; tf.AddLine(w.keyword); } tf.Write(); // Write buffer to file tf.Close(); // release file handle } else Manager::Get()->GetLogManager()->DebugLog(_T("Error opening debugger watch file: ") + fname);}
but I doubt it will be enough.