Beispiel #1
0
void LLDBLocalsView::GetWatchesFromSelections(wxArrayTreeItemIds& items)
{
    items.Clear();
    wxArrayTreeItemIds arr;
    m_treeList->GetSelections(arr);

    for(size_t i = 0; i < arr.GetCount(); ++i) {
        wxTreeItemId item = arr.Item(i);
        if(!GetItemData(item)) continue;
        LLDBVariableClientData* data = GetItemData(item);
        if(!data) continue;

        LLDBVariable::Ptr_t lldbVar = data->GetVariable();
        if(!lldbVar) continue;

        if(lldbVar->IsWatch()) {
            items.Add(item);
        }
    }
}
Beispiel #2
0
void LLDBLocalsView::OnDelete(wxCommandEvent& event)
{
    wxArrayTreeItemIds items;
    GetWatchesFromSelections(items);
    if(items.IsEmpty()) return;

    for(size_t i = 0; i < items.GetCount(); ++i) {
        wxTreeItemId item = items.Item(i);
        if(!GetItemData(item)) continue;
        LLDBVariableClientData* data = GetItemData(item);
        if(!data) continue;

        LLDBVariable::Ptr_t lldbVar = data->GetVariable();
        if(!lldbVar) continue;

        if(lldbVar->IsWatch()) {
            m_plugin->GetLLDB()->DeleteWatch(lldbVar->GetLldbId());
        }
    }
    // Refresh the locals view
    m_plugin->GetLLDB()->RequestLocals();
}