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

Some thoughts on doing breakpoints persistent

<< < (6/9) > >>

Jenna:
I did not (yet)test it, but what came in my mind:

what about the other attributes of the breakpoints and watches ?

The breakpoints might be data, function or conditional breakpoints (might be more possibilities, I don't know at the moment).
The same is for watches: might be watches as character, hex ..., or as array with begin and count.

ollydbg:
hehe, this is the first step.

I only add codes in debuggerGDB.cpp. For "watches types" and "breakpoints types", things will be more complicated, so, they should be added to the separate cpp and h files.

MortenMacFly:

--- Quote from: jens on June 20, 2009, 03:44:53 pm ---The same is for watches: might be watches as character, hex ..., or as array with begin and count.

--- End quote ---
Notice that watches can already be saved / loaded (including this info).

ollydbg:

--- Quote from: MortenMacFly on June 22, 2009, 06:55:10 am ---
--- Quote from: jens on June 20, 2009, 03:44:53 pm ---The same is for watches: might be watches as character, hex ..., or as array with begin and count.

--- End quote ---
Notice that watches can already be saved / loaded (including this info).

--- End quote ---

Where can I find the code? (save watches with other info?)

The only code I can find is:


--- Code: ---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);
}
--- End code ---

Seems no other info was saved :(

ollydbg:
Active this thread :)
What should we do if we want to save all the user setting information in one file, those include:
The setting should be one file for each c::b project.
1, project layout (which file of the project should be opened/shown after loading the project), caret position
2, breakpoints
3, watches
4, bookmarks
5, other user setting dedicated to the project file.

We should unify the interface, but I have no idea how to implement this.

The user setting file should be saved/loaded as the same time as "bool cbProject::SaveLayout() and bool cbProject::LoadLayout()".

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version