Beispiel #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); }
}
Beispiel #2
0
void LLDBPlugin::OnDebugShowCursor(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    if(m_connector.IsCanInteract()) {
        m_connector.ShowCurrentFileLine();
    }
}
Beispiel #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();
    }
}
Beispiel #4
0
void LLDBPlugin::OnDebugNextInst(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    if(m_connector.IsCanInteract()) {
        m_connector.NextInstruction();
    }
}
Beispiel #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);
}
Beispiel #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));
    }
}
Beispiel #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);
}
Beispiel #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();
}
Beispiel #9
0
void LLDBPlugin::OnDebugStepOut(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    m_connector.StepOut();
}
Beispiel #10
0
void LLDBPlugin::OnDebugCanInteract(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    event.SetAnswer(m_connector.IsCanInteract());
}
Beispiel #11
0
void LLDBPlugin::OnDebugIsRunning(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    event.SetAnswer(m_connector.IsRunning());
}
Beispiel #12
0
void LLDBPlugin::OnDebugStop(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    CL_DEBUG("LLDB    >> Stop");
    m_connector.Stop();
}
Beispiel #13
0
void LLDBPlugin::OnDebugNext(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    CL_DEBUG("LLDB    >> Next");
    m_connector.Next();
}
Beispiel #14
0
void LLDBPlugin::OnDebugVOID(clDebugEvent& event) { CHECK_IS_LLDB_SESSION(); }
Beispiel #15
0
void LLDBDebuggerPlugin::OnDebugStop(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    CL_DEBUG("LLDB    >> Stop");
    m_debugger.Stop();
}
Beispiel #16
0
void LLDBDebuggerPlugin::OnDebugNext(clDebugEvent& event)
{
    CHECK_IS_LLDB_SESSION();
    CL_DEBUG("LLDB    >> Next");
    m_debugger.StepOver();
}