コード例 #1
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::DeleteAllBreakpoints()
{
    if(!IsRunning()) {
        m_pendingDeletionBreakpoints.clear();
        m_breakpoints.clear();

        LLDBEvent event(wxEVT_LLDB_BREAKPOINTS_UPDATED);
        event.SetBreakpoints(GetAllBreakpoints());
        ProcessEvent(event);
        return;
    }

    // mark all breakpoints for deletion
    CL_DEBUGS(wxString() << "codelite: DeleteAllBreakpoints called");
    m_pendingDeletionBreakpoints.swap(m_breakpoints);

    if(!IsCanInteract()) {
        Interrupt(kInterruptReasonDeleteAllBreakpoints);

    } else {
        LLDBCommand command;
        command.SetCommandType(kCommandDeleteAllBreakpoints);
        SendCommand(command);
        m_pendingDeletionBreakpoints.clear();
    }
}
コード例 #2
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::SendInterperterCommand(const wxString& command)
{
    LLDBCommand lldbCommand;
    lldbCommand.SetCommandType(kCommandInterperterCommand);
    lldbCommand.SetExpression(command);
    SendCommand(lldbCommand);
}
コード例 #3
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::AddWatch(const wxString& watch)
{
    LLDBCommand command;
    command.SetCommandType(kCommandAddWatch);
    command.SetExpression(watch);
    SendCommand(command);
}
コード例 #4
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::Interrupt(eInterruptReason reason)
{
    LLDBCommand command;
    command.SetCommandType(kCommandInterrupt);
    command.SetInterruptReason(reason);
    SendCommand(command);
}
コード例 #5
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::DeleteWatch(int lldbId)
{
    LLDBCommand command;
    command.SetCommandType(kCommandDeleteWatch);
    command.SetLldbId(lldbId);
    SendCommand(command);
}
コード例 #6
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::RequestLocals()
{
    if(IsCanInteract()) {
        LLDBCommand command;
        command.SetCommandType(kCommandGetLocals);
        SendCommand(command);
    }
}
コード例 #7
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::NextInstruction()
{
    if(IsCanInteract()) {
        LLDBCommand command;
        command.SetCommandType(kCommandNextInstruction);
        SendCommand(command);
    }
}
コード例 #8
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::ShowCurrentFileLine()
{
    if(IsCanInteract()) {
        LLDBCommand command;
        command.SetCommandType(kCommandCurrentFileLine);
        SendCommand(command);
    }
}
コード例 #9
0
ファイル: MainDialog.cpp プロジェクト: qioixiy/codelite
void MainDialog::OnStart(wxCommandEvent& event)
{
    LLDBCommand command;
    command.SetCommandType( kCommandStart );
    command.SetExecutable( m_filePickerExe->GetPath() );
    m_connector.SendCommand( command );
    LogCommand( command );
}
コード例 #10
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::RequestVariableChildren(int lldbId)
{
    if(IsCanInteract()) {
        LLDBCommand command;
        command.SetCommandType(kCommandExpandVariable);
        command.SetLldbId(lldbId);
        SendCommand(command);
    }
}
コード例 #11
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::SelectThread(int threadID)
{
    if(IsCanInteract()) {
        LLDBCommand command;
        command.SetCommandType(kCommandSelectThread);
        command.SetThreadId(threadID);
        SendCommand(command);
    }
}
コード例 #12
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::EvaluateExpression(const wxString& expression)
{
    if(IsCanInteract()) {
        LLDBCommand command;
        command.SetCommandType(kCommandEvalExpression);
        command.SetExpression(expression);
        SendCommand(command);
    }
}
コード例 #13
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::SelectFrame(int frameID)
{
    if(IsCanInteract()) {
        LLDBCommand command;
        command.SetCommandType(kCommandSelectFrame);
        command.SetFrameId(frameID);
        SendCommand(command);
    }
}
コード例 #14
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::Stop()
{
    if(IsAttachedToProcess()) {
        Detach();

    } else {
        LLDBCommand command;
        command.SetCommandType(kCommandStop);
        SendCommand(command);
    }
}
コード例 #15
0
ファイル: MainDialog.cpp プロジェクト: qioixiy/codelite
void MainDialog::OnLLDBStarted(LLDBEvent& e)
{
    e.Skip();
    m_textCtrlLog->AppendText(wxString() << "LLDB Started successfully\n");
    
    LLDBCommand command;
    command.SetCommandType( kCommandRun );
    command.SetCommandArguments( "" );
    m_connector.SendCommand( command );
    m_textCtrlLog->AppendText("Running...\n");
}
コード例 #16
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::Detach()
{
    if(IsCanInteract()) {
        CL_DEBUG("Sending 'Detach' command");
        LLDBCommand command;
        command.SetCommandType(kCommandDetach);
        SendCommand(command);

    } else {
        Interrupt(kInterruptReasonDetaching);
    }
}
コード例 #17
0
ファイル: LLDBConnector.cpp プロジェクト: qioixiy/codelite
void LLDBConnector::Start(const LLDBCommand& runCommand)
{
    LLDBCommand startCommand;
    startCommand.SetExecutable( runCommand.GetExecutable() );
    startCommand.SetCommandType( kCommandStart );
    SendCommand( startCommand );

    // stash the runCommand for the future 'Run()' call
    m_runCommand.Clear();
    m_runCommand = runCommand;
    m_runCommand.SetCommandType( kCommandRun );
}
コード例 #18
0
ファイル: LLDBPlugin.cpp プロジェクト: raresp/codelite
void LLDBPlugin::OnDebugAttachToProcess(clDebugEvent& event)
{
    if(event.GetDebuggerName() != LLDB_DEBUGGER_NAME) {
        event.Skip();
        return;
    }

#ifdef __WXMSW__
    ::wxMessageBox(
        _("Attach to process with LLDB is not supported under Windows"), "CodeLite", wxOK | wxCENTER | wxICON_WARNING);
    return;
#endif

    wxString terminalTitle;
    terminalTitle << "Console PID " << event.GetInt();
    if(!DoInitializeDebugger(event, true, terminalTitle))
        return;

    LLDBConnectReturnObject retObj;
    LLDBSettings settings;
    settings.Load();

    if(m_connector.Connect(retObj, settings, 5)) {

        // Apply the environment
        EnvSetter env;

        // remove all breakpoints from previous session
        m_connector.DeleteAllBreakpoints();
        LLDBSettings settings;
        settings.Load();

        // Attach to the process
        LLDBCommand command;
        command.SetCommandType(kCommandAttachProcess);
        command.SetProcessID(event.GetInt());
        command.SetSettings(settings);
        m_connector.AttachProcessWithPID(command);

    } else {
        // Failed to connect, notify and perform cleanup
        DoCleanup();
        wxString message;
        message << _("Could not connect to codelite-lldb at '") << m_connector.GetConnectString() << "'";
        ::wxMessageBox(message, "CodeLite", wxICON_ERROR | wxOK | wxCENTER);
        return;
    }
}
コード例 #19
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::ApplyBreakpoints()
{
    if(!m_breakpoints.empty()) {

        if(IsCanInteract()) {
            LLDBCommand command;
            command.SetCommandType(kCommandApplyBreakpoints);
            command.SetBreakpoints(GetUnappliedBreakpoints());
            SendCommand(command);
            m_breakpoints.clear();

        } else {
            Interrupt(kInterruptReasonApplyBreakpoints);
        }
    }
}
コード例 #20
0
void LLDBConnector::DeleteBreakpoints()
{
    if ( IsCanInteract() ) {
        CL_DEBUGS(wxString () << "codelite: deleting breakpoints (total of " << m_pendingDeletionBreakpoints.size() << " breakpoints)");
        LLDBCommand command;
        command.SetCommandType( kCommandDeleteBreakpoint );
        command.SetBreakpoints( m_pendingDeletionBreakpoints );
        SendCommand( command );
        CL_DEBUGS(wxString () << "codelite: DeleteBreakpoints celar pending deletionbreakpoints queue");
        m_pendingDeletionBreakpoints.clear();
    
    } else {
        CL_DEBUG("codelite: interrupting codelite-lldb for kInterruptReasonDeleteBreakpoint");
        Interrupt( kInterruptReasonDeleteBreakpoint );
    }
}
コード例 #21
0
ファイル: LLDBPlugin.cpp プロジェクト: GaganJotSingh/codelite
void LLDBPlugin::OnDebugCoreFile(clDebugEvent& event)
{
    if(event.GetDebuggerName() != LLDB_DEBUGGER_NAME) {
        event.Skip();
        return;
    }

#ifdef __WXMSW__
    ::wxMessageBox(
        _("Debug core file with LLDB is not supported under Windows"), "CodeLite", wxOK | wxCENTER | wxICON_WARNING);
    return;
#endif

    if(!DoInitializeDebugger(event, false)) {
        return;
    }

    LLDBConnectReturnObject retObj;
    LLDBSettings settings;
    settings.Load();

    if(m_connector.Connect(retObj, settings, 5)) {

        // Apply the environment
        EnvSetter env;

        // remove all breakpoints from previous session
        m_connector.DeleteAllBreakpoints();

        LLDBCommand startCommand;
        startCommand.FillEnvFromMemory();
        startCommand.SetCommandType(kCommandDebugCoreFile);
        startCommand.SetExecutable(event.GetExecutableName());
        startCommand.SetCorefile(event.GetCoreFile());
        startCommand.SetWorkingDirectory(event.GetWorkingDirectory());
        startCommand.SetRedirectTTY(m_terminalTTY);
        m_connector.OpenCoreFile(startCommand);
    } else {
        // Failed to connect, notify and perform cleanup
        DoCleanup();
        wxString message;
        message << _("Could not connect to codelite-lldb at '") << m_connector.GetConnectString() << "'";
        ::wxMessageBox(message, "CodeLite", wxICON_ERROR | wxOK | wxCENTER);
        return;
    }
}
コード例 #22
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::Start(const LLDBCommand& runCommand)
{
    LLDBCommand startCommand;
    startCommand.SetExecutable(runCommand.GetExecutable());
    startCommand.SetCommandType(kCommandStart);
    startCommand.SetWorkingDirectory(runCommand.GetWorkingDirectory());

    // send the settings as well
    LLDBSettings settings;
    settings.Load();
    startCommand.SetSettings(settings);
    SendCommand(startCommand);

    // stash the runCommand for the future 'Run()' call
    m_runCommand.Clear();
    m_runCommand = runCommand;
    m_runCommand.SetCommandType(kCommandRun);
}
コード例 #23
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::Continue()
{
    LLDBCommand command;
    command.SetCommandType(kCommandContinue);
    SendCommand(command);
}
コード例 #24
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::Next()
{
    LLDBCommand command;
    command.SetCommandType(kCommandNext);
    SendCommand(command);
}
コード例 #25
0
ファイル: LLDBConnector.cpp プロジェクト: stahta01/codelite
void LLDBConnector::StepOut()
{
    LLDBCommand command;
    command.SetCommandType(kCommandStepOut);
    SendCommand(command);
}