Neive avatar Neive committed 2ed8060

Fixed breakpoint related bugs

Comments (0)

Files changed (3)

debugger/breakpoint.cpp

         breakmap.erase(bpt->address + i);
 
     auto range = breaks.equal_range(&bpt->name);
+    auto to_be_deleted = breaks.end();
     for (auto it = range.first; it != range.second; ++it)
     {
         Breakpoint *entry = it->second;
         if (entry == bpt)
         {
-            breaks.erase(it);
+            to_be_deleted = it;
         }
         else if (entry->id > old_id) // Core does this too, so it has to be mimiced (maybe shouldn't use ids at all)
         {
             entry->id -= 1;
         }
     }
+    if (to_be_deleted != breaks.end())
+        breaks.erase(to_be_deleted);
 }
 
 unique_ptr<Breakpoint *[]> BreakpointInterface::FindByName(const wxString &name, int *amt)

debugger/breakpointpanel.cpp

     wxMenuItem *add, *edit, *remove, *disable, *enable, *separator;
     add = new wxMenuItem(&menu, break_add, _("New..\tCtrl-A"));
     menu.Append(add);
-    if (list->GetSelection().GetID() != 0) // wx 2.9.3: list->GetSelectedItemsCount() == 1 or list->HasSelecion()
+    if (list->HasSelection())
     {
-        edit = new wxMenuItem(&menu, break_edit, _("Edit..\tCtrl-E"));
-        menu.Append(edit);
+        if (list->GetSelection().GetID() != 0) // wx 2.9.3: list->GetSelectedItemsCount() == 1 or list->HasSelecion()
+        {
+            edit = new wxMenuItem(&menu, break_edit, _("Edit..\tCtrl-E"));
+            menu.Append(edit);
+        }
+        disable = new wxMenuItem(&menu, break_disable, _("Disable"));
+        menu.Append(disable);
+        enable = new wxMenuItem(&menu, break_enable, _("Enable"));
+        menu.Append(enable);
+        remove = new wxMenuItem(&menu, break_delete, _("Delete\tDel"));
+        menu.Append(remove);
     }
-    disable = new wxMenuItem(&menu, break_disable, _("Disable"));
-    menu.Append(disable);
-    enable = new wxMenuItem(&menu, break_enable, _("Enable"));
-    menu.Append(enable);
-    remove = new wxMenuItem(&menu, break_delete, _("Delete\tDel"));
-    menu.Append(remove);
 
     separator = new wxMenuItem(&menu);
     menu.Append(separator);

debugger/dv_treelist.cpp

     delete item;
 
     value_lookup.erase(it);
+    if (value_lookup.empty()) // Without this weird display lock would happen on windows
+        Cleared();
 }
 
 void DataViewTreeListModel::Clear()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.