Ejemplo n.º 1
0
void EvalPane::OnExpressionEvaluate(XDebugEvent& e)
{
    if ( e.GetEvalReason() == XDebugEvalCmdHandler::kEvalForEvalPane ) {
        
        m_stcOutput->SetEditable(true);
        m_stcOutput->ClearAll();


        wxString str;
        if ( !e.IsEvalSucceeded() ) {
            str << _("*** Error evaluating expression: ") << e.GetString() << "\n"
                << e.GetErrorString();
        } else {
            str << e.GetString() << " = \n";
            wxString evaluated = e.GetEvaluted();
            // Reomve extra escapes
            evaluated.Replace("\\n", "\n");
            evaluated.Replace("\\t", "\t");
            evaluated.Replace("\\r", "\r");
            evaluated.Replace("\\v", "\v");
            evaluated.Replace("\\b", "\b");
            str << evaluated;
        }

        m_stcOutput->AppendText( str );
        m_stcOutput->SetEditable(false);
        m_stcOutput->ScrollToEnd();
        
    } else {
        e.Skip();
    }
}
Ejemplo n.º 2
0
void LocalsView::OnProperytGet(XDebugEvent& e)
{
    e.Skip();
    // An item was evaluated using property_get
    std::map<wxString, wxDataViewItem>::iterator iter = m_waitingExpand.find( e.GetEvaluted() );
    if ( iter == m_waitingExpand.end() ) {
        return;
    }
    
    wxDataViewItem item = iter->second;
    m_waitingExpand.erase( iter );
    
    // Delete the fake node
    wxDataViewItemArray children;
    m_dataviewModel->GetChildren( item, children );
    if ( !children.IsEmpty() ) {
        m_dataviewModel->DeleteItems( item, children );
    }
    
    XVariable::List_t vars = e.GetVariables();
    if ( vars.empty() ) 
        return;
    
    // Since we got here from property_get, XDebug will reply with the specific property (e.g. $myclass->secondClass)
    // and all its children. Howeverr, $myclass->secondClass already exist in the tree
    // so we are only interested with its children. so we use here vars.begin()->children (vars is always list of size == 1)
    wxASSERT_MSG(vars.size() == 1, "property_get returned list of size != 1");
    XVariable::List_t childs;
    childs = vars.begin()->children;

    if ( !childs.empty() ) {
        AppendVariablesToTree( item, childs );
        m_dataview->Expand( item );
    }
}
Ejemplo n.º 3
0
void EvalPane::OnDBGPCommandEvaluated(XDebugEvent& e)
{
    e.Skip();
    m_stcOutputXDebug->SetEditable(true);
    m_stcOutputXDebug->ClearAll();
    m_stcOutputXDebug->SetText(e.GetEvaluted());
    m_stcOutputXDebug->SetEditable(true);
    m_stcOutputXDebug->ScrollToEnd();
}
Ejemplo n.º 4
0
void XDebugManager::OnShowTooltip(XDebugEvent& e)
{
    if ( e.GetEvalReason() == XDebugEvalCmdHandler::kEvalForTooltip ) {
        wxString str;
        if ( !e.IsEvalSucceeded() ) {
            str << _("<color=\"red\">*** Error evaluating expression : </color><strong>") << e.GetString() << "</strong>\n<hr>"
                << e.GetErrorString();
        } else {
            str << "<b>" << e.GetString() << "</b>\n<hr>";
            wxString evaluated = e.GetEvaluted();
            // Reomve extra escapes
            evaluated.Replace("\\n", "\n");
            evaluated.Replace("\\t", "\t");
            evaluated.Replace("\\r", "\r");
            evaluated.Replace("\\v", "\v");
            evaluated.Replace("\\b", "\b");
            str << evaluated;
            str.Trim();
        }
        m_plugin->GetManager()->GetActiveEditor()->ShowRichTooltip( str, wxNOT_FOUND );
    } else {
        e.Skip();
    }
}