当前位置: 首页>>代码示例>>C++>>正文


C++ LLDBReply::SetReplyType方法代码示例

本文整理汇总了C++中LLDBReply::SetReplyType方法的典型用法代码示例。如果您正苦于以下问题:C++ LLDBReply::SetReplyType方法的具体用法?C++ LLDBReply::SetReplyType怎么用?C++ LLDBReply::SetReplyType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLDBReply的用法示例。


在下文中一共展示了LLDBReply::SetReplyType方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: EvalExpression

void CodeLiteLLDBApp::EvalExpression(const LLDBCommand& command)
{
    wxPrintf("codelite-lldb: evaluating expression '%s'\n", command.GetExpression());

    if(CanInteract()) {
        lldb::SBExpressionOptions options;
        lldb::SBValue value = m_target.EvaluateExpression(command.GetExpression().mb_str(wxConvUTF8).data(), options);
        if(value.IsValid()) {

            LLDBReply reply;
            reply.SetReplyType(kReplyTypeExprEvaluated);
            reply.SetExpression(command.GetExpression());

            LLDBVariable::Vect_t vars;
            LLDBVariable::Ptr_t var(new LLDBVariable(value));
            vars.push_back(var);
            reply.SetVariables(vars);
            VariableWrapper wrapper;
            wrapper.value = value;
            // Cache the expanded variable (we will need it later for tooltip expansion
            m_variables.insert(std::make_pair(value.GetID(), wrapper));

            SendReply(reply);
        }
    }
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:26,代码来源:CodeLiteLLDBApp.cpp

示例2: EvalExpression

void CodeLiteLLDBApp::EvalExpression(const LLDBCommand& command)
{
    wxPrintf("codelite-lldb: evaluating expression '%s'\n", command.GetExpression());

    if(CanInteract()) {
        // Evaluate the expression based on the current frame
        wxString expression = command.GetExpression();
        expression.Trim().Trim(false);
        lldb::SBValue value = m_target.GetProcess().GetSelectedThread().GetSelectedFrame().GetValueForVariablePath(
            expression.mb_str(wxConvUTF8).data());
        if(value.IsValid()) {

            LLDBReply reply;
            reply.SetReplyType(kReplyTypeExprEvaluated);
            reply.SetExpression(command.GetExpression());

            LLDBVariable::Vect_t vars;
            LLDBVariable::Ptr_t var(new LLDBVariable(value));
            vars.push_back(var);
            reply.SetVariables(vars);
            VariableWrapper wrapper;
            wrapper.value = value;
            // Cache the expanded variable (we will need it later for tooltip expansion
            m_variables.insert(std::make_pair(value.GetID(), wrapper));

            SendReply(reply);
        }
    }
}
开发者ID:292388900,项目名称:codelite,代码行数:29,代码来源:CodeLiteLLDBApp.cpp

示例3: NotifyLocals

void CodeLiteLLDBApp::NotifyLocals(LLDBVariable::Vect_t locals)
{
    wxPrintf("codelite-lldb: NotifyLocals called with %d locals\n", (int)locals.size());
    LLDBReply reply;
    reply.SetReplyType(kReplyTypeLocalsUpdated);
    reply.SetVariables(locals);
    SendReply(reply);
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:8,代码来源:CodeLiteLLDBApp.cpp

示例4: NotifyRunning

void CodeLiteLLDBApp::NotifyRunning()
{
    wxPrintf("codelite-lldb: NotifyRunning. Target Process ID %d\n", m_debuggeePid);
    m_variables.clear();
    LLDBReply reply;
    reply.SetReplyType(kReplyTypeDebuggerRunning);
    SendReply(reply);
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:8,代码来源:CodeLiteLLDBApp.cpp

示例5: NotifyStoppedOnFirstEntry

void CodeLiteLLDBApp::NotifyStoppedOnFirstEntry()
{
    wxPrintf("codelite-lldb: NotifyStoppedOnFirstEntry()\n");
    m_variables.clear();
    LLDBReply reply;
    reply.SetReplyType( kReplyTypeDebuggerStoppedOnFirstEntry );
    SendReply( reply );
}
开发者ID:mixpro,项目名称:codelite,代码行数:8,代码来源:CodeLiteLLDBApp.cpp

示例6: ExecuteInterperterCommand

void CodeLiteLLDBApp::ExecuteInterperterCommand(const LLDBCommand& command)
{
    
    lldb::SBCommandReturnObject ret;
    std::string c_command = command.GetExpression().mb_str(wxConvUTF8).data();
    wxPrintf("codelite-lldb: ExecuteInterperterCommand: '%s'\n", c_command.c_str());
    m_debugger.GetCommandInterpreter().HandleCommand(c_command.c_str(), ret);
    
    if(ret.GetOutput()) {
        LLDBReply reply;
        reply.SetText(ret.GetOutput());
        reply.SetReplyType(kReplyTypeInterperterReply);
        SendReply(reply);
    } else if(ret.GetError()) {
        LLDBReply reply;
        reply.SetText(ret.GetError());
        reply.SetReplyType(kReplyTypeInterperterReply);
        SendReply(reply);
    }
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:20,代码来源:CodeLiteLLDBApp.cpp

示例7: NotifyExited

void CodeLiteLLDBApp::NotifyExited()
{
    wxPrintf("codelite-lldb: NotifyExited called\n");
    LLDBReply reply;
    reply.SetReplyType(kReplyTypeDebuggerExited);
    SendReply(reply);

    // Let codelite 200 ms head start before starting the cleanup process
    // by doing this, codelite can mark the debugger in "normal" shutdown
    wxThread::Sleep(200);
    Cleanup();
    m_exitMainLoop = true;
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:13,代码来源:CodeLiteLLDBApp.cpp

示例8: NotifyBreakpointsUpdated

void CodeLiteLLDBApp::NotifyBreakpointsUpdated()
{
    LLDBBreakpoint::Vec_t breakpoints;
    int num = m_target.GetNumBreakpoints();
    wxPrintf("codelite-lldb: Calling NotifyBreakpointsUpdated(). Got %d breakpoints\n", num);
    for(int i=0; i<num; ++i) {
        lldb::SBBreakpoint bp = m_target.GetBreakpointAtIndex(i);
        if ( bp.IsValid() && bp.GetNumResolvedLocations() ) {
            
            // Add the parent breakpoint
            LLDBBreakpoint::Ptr_t mainBreakpoint( new LLDBBreakpoint() );
            mainBreakpoint->SetId( bp.GetID() );
            if ( bp.GetNumLocations() >  1 ) {

                // add all the children locations to the main breakpoint
                for(size_t i=0; i<bp.GetNumLocations(); ++i) {
                    lldb::SBBreakpointLocation loc = bp.GetLocationAtIndex(i);
                    
                    lldb::SBFileSpec fileLoc = loc.GetAddress().GetLineEntry().GetFileSpec();
                    wxFileName bpFile( fileLoc.GetDirectory(), fileLoc.GetFilename() );

                    // Create a breakpoint for this location
                    LLDBBreakpoint::Ptr_t new_bp(new LLDBBreakpoint());
                    new_bp->SetType( LLDBBreakpoint::kLocation );
                    new_bp->SetFilename( bpFile.GetFullPath() );
                    new_bp->SetLineNumber( loc.GetAddress().GetLineEntry().GetLine() );
                    new_bp->SetName( loc.GetAddress().GetFunction().GetName() );
                    mainBreakpoint->GetChildren().push_back( new_bp );
            }

            } else {
                lldb::SBBreakpointLocation loc = bp.GetLocationAtIndex(0);
                lldb::SBFileSpec fileLoc = loc.GetAddress().GetLineEntry().GetFileSpec();
                wxFileName bpFile( fileLoc.GetDirectory(), fileLoc.GetFilename() );
                
                mainBreakpoint->SetType( LLDBBreakpoint::kFileLine );
                mainBreakpoint->SetName( loc.GetAddress().GetFunction().GetName() );
                mainBreakpoint->SetFilename( bpFile.GetFullPath() );
                mainBreakpoint->SetLineNumber( loc.GetAddress().GetLineEntry().GetLine() );
                
            }
            breakpoints.push_back( mainBreakpoint );
        }
    }
    
    LLDBReply reply;
    reply.SetReplyType( kReplyTypeBreakpointsUpdated );
    reply.SetBreakpoints( breakpoints );
    SendReply( reply );
}
开发者ID:mixpro,项目名称:codelite,代码行数:50,代码来源:CodeLiteLLDBApp.cpp

示例9: ExpandVariable

// we need to return list of children for a variable
// we stashed the variables we got so far inside a map
void CodeLiteLLDBApp::ExpandVariable(const LLDBCommand& command)
{
    int variableId = command.GetLldbId();
    if(variableId == wxNOT_FOUND) {
        return;
    }

    LLDBVariable::Vect_t children;
    std::map<int, VariableWrapper>::iterator iter = m_variables.find(variableId);
    if(iter != m_variables.end()) {
        lldb::SBValue* pvalue = &(iter->second.value);
        lldb::SBValue deReferencedValue;
        int size = pvalue->GetNumChildren();

        lldb::TypeClass typeClass = pvalue->GetType().GetTypeClass();
        if(typeClass & lldb::eTypeClassArray) {
            size > (int)m_settings.GetMaxArrayElements() ? size = m_settings.GetMaxArrayElements() : size = size;
            wxPrintf("codelite-lldb: value %s is an array. Limiting its size\n", pvalue->GetName());
        } /*else if ( typeClass & lldb::eTypeClassPointer ) {
            // dereference is needed
            wxPrintf("codelite-lldb: value '%s' is a class pointer, dereferecning it\n", pvalue->GetName());
            deReferencedValue = pvalue->Dereference();

            // and update the number of children
            pvalue = &deReferencedValue;

            wxPrintf("codelite-lldb: new number of children is set to %d\n", size);
            size = pvalue->GetNumChildren();
        }*/

        for(int i = 0; i < size; ++i) {
            lldb::SBValue child = pvalue->GetChildAtIndex(i);
            if(child.IsValid()) {
                LLDBVariable::Ptr_t var(new LLDBVariable(child));
                children.push_back(var);
                VariableWrapper wrapper;
                wrapper.value = child;
                m_variables.insert(std::make_pair(child.GetID(), wrapper));
            }
        }

        LLDBReply reply;
        reply.SetReplyType(kReplyTypeVariableExpanded);
        reply.SetVariables(children);
        reply.SetLldbId(variableId);
        SendReply(reply);
    }
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:50,代码来源:CodeLiteLLDBApp.cpp

示例10: NotifyStarted

void CodeLiteLLDBApp::NotifyStarted(eLLDBDebugSessionType sessionType)
{
    switch(sessionType) {
    case kDebugSessionTypeAttach:
        wxPrintf("codelite-lldb: NotifyStarted called (kDebugSessionTypeAttach)\n");
        break;
    case kDebugSessionTypeCore:
        wxPrintf("codelite-lldb: NotifyStarted called (kDebugSessionTypeCore)\n");
        break;
    case kDebugSessionTypeNormal:
        wxPrintf("codelite-lldb: NotifyStarted called (kDebugSessionTypeNormal)\n");
        break;
    }
    m_sessionType = sessionType;
    m_variables.clear();
    LLDBReply reply;
    reply.SetDebugSessionType(sessionType);
    reply.SetReplyType(kReplyTypeDebuggerStartedSuccessfully);
    SendReply(reply);
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:20,代码来源:CodeLiteLLDBApp.cpp

示例11: NotifyStopped

void CodeLiteLLDBApp::NotifyStopped()
{
    m_variables.clear();
    LLDBReply reply;
    wxPrintf("codelite-lldb: NotifyStopped() called. m_interruptReason=%d\n", (int)m_interruptReason);
    reply.SetReplyType(kReplyTypeDebuggerStopped);
    reply.SetInterruptResaon(m_interruptReason);

    // If we find a thread that was stopped due to breakpoint, make it the active one
    int threadCount = m_target.GetProcess().GetNumThreads();
    for(int i = 0; i < threadCount; ++i) {
        lldb::SBThread thr = m_target.GetProcess().GetThreadAtIndex(i);
        if(thr.GetStopReason() == lldb::eStopReasonBreakpoint) {
            m_target.GetProcess().SetSelectedThread(thr);
            break;
        }
    }

    lldb::SBThread thread = m_target.GetProcess().GetSelectedThread();
    LLDBBacktrace bt(thread, m_settings);
    reply.SetBacktrace(bt);

    int selectedThreadId = thread.GetThreadID();

    // set the selected frame file:line
    if(thread.IsValid() && thread.GetSelectedFrame().IsValid()) {
        lldb::SBFrame frame = thread.GetSelectedFrame();
        lldb::SBLineEntry lineEntry = thread.GetSelectedFrame().GetLineEntry();
        if(lineEntry.IsValid()) {
            reply.SetLine(lineEntry.GetLine());
            lldb::SBFileSpec fileSepc = frame.GetLineEntry().GetFileSpec();
            reply.SetFilename(wxFileName(fileSepc.GetDirectory(), fileSepc.GetFilename()).GetFullPath());
        }
    }

    // Prepare list of threads
    LLDBThread::Vect_t threads;
    for(int i = 0; i < threadCount; ++i) {
        LLDBThread t;
        lldb::SBThread thr = m_target.GetProcess().GetThreadAtIndex(i);
        t.SetStopReason(thr.GetStopReason());
        t.SetId(thr.GetThreadID());
        t.SetActive(selectedThreadId == (int)thr.GetThreadID());
        lldb::SBFrame frame = thr.GetSelectedFrame();
        t.SetFunc(frame.GetFunctionName() ? frame.GetFunctionName() : "");
        lldb::SBLineEntry lineEntry = thr.GetSelectedFrame().GetLineEntry();

        // get the stop reason string
        char buffer[1024];
        memset(buffer, 0x0, sizeof(buffer));
        thr.GetStopDescription(buffer, sizeof(buffer));
        t.SetStopReasonString(buffer);

        wxPrintf("codelite-lldb: thread %d stop reason is %s\n", t.GetId(), t.GetStopReasonString());
        if(lineEntry.IsValid()) {
            t.SetLine(lineEntry.GetLine());
            lldb::SBFileSpec fileSepc = frame.GetLineEntry().GetFileSpec();
            t.SetFile(wxFileName(fileSepc.GetDirectory(), fileSepc.GetFilename()).GetFullPath());
        }
        threads.push_back(t);
    }

    reply.SetThreads(threads);
    SendReply(reply);

    // reset the interrupt reason
    m_interruptReason = kInterruptReasonNone;
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:68,代码来源:CodeLiteLLDBApp.cpp

示例12: NotifyAllBreakpointsDeleted

void CodeLiteLLDBApp::NotifyAllBreakpointsDeleted()
{
    LLDBReply reply;
    reply.SetReplyType(kReplyTypeAllBreakpointsDeleted);
    SendReply(reply);
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:6,代码来源:CodeLiteLLDBApp.cpp


注:本文中的LLDBReply::SetReplyType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。