Ejemplo n.º 1
0
void LLDBPlugin::OnToggleInterrupt(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    event.Skip();
    CL_DEBUG("CODELITE: interrupting debuggee");
    if(!m_connector.IsCanInteract()) { m_connector.Interrupt(kInterruptReasonNone); }
}
Ejemplo n.º 2
0
void LLDBPlugin::OnDebugShowCursor(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    if(m_connector.IsCanInteract()) {
        m_connector.ShowCurrentFileLine();
    }
}
Ejemplo n.º 3
0
void LLDBPlugin::OnToggleBreakpoint(clDebugEvent& event)
{
    // Call Skip() here since we want codelite to manage the breakpoint as well ( in term of serialization in the
    // session file )
    CHECK_IS_LLDB_SESSION();

    // check to see if we are removing a breakpoint or adding one
    LLDBBreakpoint::Ptr_t bp(new LLDBBreakpoint(event.GetFileName(), event.GetInt()));
    IEditor* editor = m_mgr->GetActiveEditor();

    if(editor) {
        // get the marker type set on the line
        int markerType = editor->GetCtrl()->MarkerGet(bp->GetLineNumber() - 1);
        for(size_t type = smt_FIRST_BP_TYPE; type <= smt_LAST_BP_TYPE; ++type) {
            int markerMask = (1 << type);
            if(markerType & markerMask) {
                // removing a breakpoint. "DeleteBreakpoint" will handle the interactive/non-interactive mode
                // of the debugger
                m_connector.MarkBreakpointForDeletion(bp);
                m_connector.DeleteBreakpoints();
                return;
            }
        }

        // if we got here, its a new breakpoint, add it
        // Add the breakpoint to the list of breakpoints
        m_connector.AddBreakpoint(bp->GetFilename(), bp->GetLineNumber());

        // apply it. In case the debugger can not interact with, it will be interrupted and the interrupt reason
        // will be set to ApplyBreakpoints
        m_connector.ApplyBreakpoints();
    }
}
Ejemplo n.º 4
0
void LLDBPlugin::OnDebugNextInst(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    if(m_connector.IsCanInteract()) {
        m_connector.NextInstruction();
    }
}
Ejemplo n.º 5
0
void LLDBPlugin::OnJumpToCursor(wxCommandEvent& event)
{
    CHECK_IS_LLDB_SESSION();

    const auto editor = m_mgr->GetActiveEditor();
    if(!editor) { return; }

    m_connector.JumpTo(editor->GetFileName(), editor->GetCurrentLine() + 1);
}
Ejemplo n.º 6
0
void LLDBPlugin::OnLLDBExpressionEvaluated(LLDBEvent& event)
{
    CHECK_IS_LLDB_SESSION();

    // hide any tooltip
    if(!event.GetVariables().empty() && m_mgr->GetActiveEditor()) {
        if(!m_tooltip) { m_tooltip = new LLDBTooltip(this); }
        m_tooltip->Show(event.GetExpression(), event.GetVariables().at(0));
    }
}
Ejemplo n.º 7
0
void LLDBPlugin::OnDebugTooltip(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();

    // FIXME: use the function ::GetCppExpressionFromPos() to get a better expression
    wxString expression = event.GetString();
    if(expression.IsEmpty()) return;

    m_connector.EvaluateExpression(expression);
}
Ejemplo n.º 8
0
void LLDBPlugin::OnAddWatch(wxCommandEvent& event)
{
    CHECK_IS_LLDB_SESSION();

    const auto editor = m_mgr->GetActiveEditor();
    if(!editor) { return; }

    const auto watchWord = GetWatchWord(*editor);
    if(watchWord.IsEmpty()) { return; }

    GetLLDB()->AddWatch(watchWord);

    // Refresh the locals view
    GetLLDB()->RequestLocals();
}
Ejemplo n.º 9
0
void LLDBPlugin::OnDebugStepOut(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    m_connector.StepOut();
}
Ejemplo n.º 10
0
void LLDBPlugin::OnDebugCanInteract(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    event.SetAnswer(m_connector.IsCanInteract());
}
Ejemplo n.º 11
0
void LLDBPlugin::OnDebugIsRunning(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    event.SetAnswer(m_connector.IsRunning());
}
Ejemplo n.º 12
0
void LLDBPlugin::OnDebugStop(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    CL_DEBUG("LLDB    >> Stop");
    m_connector.Stop();
}
Ejemplo n.º 13
0
void LLDBPlugin::OnDebugNext(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    CL_DEBUG("LLDB    >> Next");
    m_connector.Next();
}
Ejemplo n.º 14
0
void LLDBPlugin::OnDebugVOID(clDebugEvent& event) { CHECK_IS_LLDB_SESSION(); }
Ejemplo n.º 15
0
void LLDBDebuggerPlugin::OnDebugStop(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    CL_DEBUG("LLDB    >> Stop");
    m_debugger.Stop();
}
Ejemplo n.º 16
0
void LLDBDebuggerPlugin::OnDebugNext(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    CL_DEBUG("LLDB    >> Next");
    m_debugger.StepOver();
}