예제 #1
0
void LLDBThreadsView::OnLLDBStopped(LLDBEvent& event)
{
    event.Skip();
    DoCleanup();
    // Update the thread view
    const LLDBThread::Vect_t& threads = event.GetThreads();
    for(size_t i = 0; i < threads.size(); ++i) {
        const LLDBThread& thr = threads.at(i);
        if(thr.IsActive()) { m_selectedThread = i; }
        wxVector<wxVariant> cols;
        cols.push_back(thr.GetId() == wxNOT_FOUND ? wxString() : wxString() << thr.GetId());
        cols.push_back(thr.GetName());
        cols.push_back(thr.GetStopReasonString());
        cols.push_back(thr.GetFunc());
        cols.push_back(m_plugin->GetFilenameForDisplay(thr.GetFile()));
        cols.push_back(thr.GetLine() == wxNOT_FOUND ? wxString() : wxString() << thr.GetLine());
        m_dvListCtrlThreads->AppendItem(cols, (wxUIntPtr) new LLDBThreadViewClientData(thr));
    }

    if((wxNOT_FOUND != m_selectedThread) && ((int)m_dvListCtrlThreads->GetItemCount() > m_selectedThread)) {
        const auto item = m_dvListCtrlThreads->RowToItem(m_selectedThread);
        if(item.IsOk()) { m_dvListCtrlThreads->EnsureVisible(item); }
    }
}