Exemple #1
0
// Add a breakpoint using the 'Properties' dialog
void BreakptMgr::AddBreakpoint()
{
    BreakptPropertiesDlg dlg(NULL);
    dlg.SetTitle(_("Create a breakpoint or watchpoint"));

    LEditor* const editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor();
    BreakpointInfo bp;
    bp.Create(editor ? editor->GetFileName().GetFullPath() : wxString(), editor ? editor->GetCurrentLine() : -1, GetNextID());
    dlg.EnterBPData(bp);

    if (dlg.ShowModal() != wxID_OK) {
        return;
    }

    if (AddBreakpoint(dlg.b)) {
        IDebugger *dbgr = DebuggerMgr::Get().GetActiveDebugger();
        if ((!dlg.b.is_enabled) && dbgr && dbgr->IsRunning()) {
            SetBPEnabledState(dlg.b.debugger_id, dlg.b.is_enabled);
        }
        wxString msg;
        if (dlg.b.bp_type == BP_type_watchpt) {
            msg = _("Watchpoint successfully added");
        } else {
            msg = _("Breakpoint successfully added");
        }
        clMainFrame::Get()->SetStatusMessage(msg, 0);
    }
}
Exemple #2
0
bool BreakptMgr::AddBreakpointByLineno(const wxString& file, const int lineno, const wxString& conditions/*=wxT("")*/, const bool is_temp, bool is_disabled)
{
    BreakpointInfo bp;
    bp.Create(file, lineno, GetNextID());
    bp.origin = BO_Editor;
    if (is_temp) {
        bp.bp_type = BP_type_tempbreak;
        bp.is_temp = true;
        
    } 
    bp.is_enabled = !is_disabled;
    bp.conditions = conditions;
    return AddBreakpoint(bp);
}
Exemple #3
0
BreakpointInfo::Vec_t LLDBBreakpoint::ToBreakpointInfoVector(const LLDBBreakpoint::Vec_t& breakpoints)
{
    BreakpointInfo::Vec_t bps;
    for(size_t i=0; i<breakpoints.size(); ++i) {

        LLDBBreakpoint::Ptr_t bp = breakpoints.at(i);
        BreakpointInfo gdbBp;
        gdbBp.Create(bp->GetFilename(), bp->GetLineNumber(), ++ s_internalGdbBpId);
        gdbBp.bp_type = BP_type_break;

        // dont add breakpoints to a non existent location
        bps.push_back( gdbBp );
    }
    return bps;
}
Exemple #4
0
bool DbgGdb::Jump(wxString filename, int line)
{
    BreakpointInfo bp;
    bp.Create(filename, line, -1);
    bp.bp_type = BP_type_tempbreak;
    Break(bp);

    // by default, use full paths for the file name
    wxFileName fn( filename );
    wxString tmpfileName( fn.GetFullPath() );
    if ( m_info.useRelativeFilePaths ) {
        // user set the option to use relative paths (file name w/o the full path)
        tmpfileName = fn.GetFullName();
    }

    tmpfileName.Replace( wxT( "\\" ), wxT( "/" ) );

    wxString command;
    command << wxT( "-exec-jump " ) << wxT( "\"\\\"" ) << tmpfileName << wxT( ":" ) << line << wxT( "\\\"\"" );
    //return WriteCommand( command, new DbgCmdHandlerAsyncCmd( m_observer, this ) );
    return ExecCLICommand( command, new DbgCmdJumpHandler( m_observer ) );
}