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


C++ lldb::SBFrame类代码示例

本文整理汇总了C++中lldb::SBFrame的典型用法代码示例。如果您正苦于以下问题:C++ SBFrame类的具体用法?C++ SBFrame怎么用?C++ SBFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: exe_ctx

void
SBThread::StepOutOfFrame (lldb::SBFrame &sb_frame)
{
    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));

    Mutex::Locker api_locker;
    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);

    StackFrameSP frame_sp (sb_frame.GetFrameSP());
    if (log)
    {
        SBStream frame_desc_strm;
        sb_frame.GetDescription (frame_desc_strm);
        log->Printf ("SBThread(%p)::StepOutOfFrame (frame = SBFrame(%p): %s)", exe_ctx.GetThreadPtr(), frame_sp.get(), frame_desc_strm.GetData());
    }

    if (exe_ctx.HasThreadScope())
    {
        bool abort_other_plans = false;
        bool stop_other_threads = false;
        Thread *thread = exe_ctx.GetThreadPtr();

        ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut (abort_other_plans,
                                                                    NULL, 
                                                                    false, 
                                                                    stop_other_threads, 
                                                                    eVoteYes, 
                                                                    eVoteNoOpinion,
                                                                    frame_sp->GetFrameIndex()));
                                                                    
        // This returns an error, we should use it!
        ResumeNewPlan (exe_ctx, new_plan_sp.get());
    }
}
开发者ID:nrgmilk,项目名称:freebsd,代码行数:34,代码来源:SBThread.cpp

示例2: GetRegister

// Internal function
void
LLDBServices::GetContextFromFrame(
    /* const */ lldb::SBFrame& frame,
    DT_CONTEXT *dtcontext)
{
#ifdef DBG_TARGET_AMD64
    dtcontext->Rip = frame.GetPC();
    dtcontext->Rsp = frame.GetSP();
    dtcontext->Rbp = frame.GetFP();
    dtcontext->EFlags = GetRegister(frame, "rflags");

    dtcontext->Rax = GetRegister(frame, "rax");
    dtcontext->Rbx = GetRegister(frame, "rbx");
    dtcontext->Rcx = GetRegister(frame, "rcx");
    dtcontext->Rdx = GetRegister(frame, "rdx");
    dtcontext->Rsi = GetRegister(frame, "rsi");
    dtcontext->Rdi = GetRegister(frame, "rdi");
    dtcontext->R8 = GetRegister(frame, "r8");
    dtcontext->R9 = GetRegister(frame, "r9");
    dtcontext->R10 = GetRegister(frame, "r10");
    dtcontext->R11 = GetRegister(frame, "r11");
    dtcontext->R12 = GetRegister(frame, "r12");
    dtcontext->R13 = GetRegister(frame, "r13");
    dtcontext->R14 = GetRegister(frame, "r14");
    dtcontext->R15 = GetRegister(frame, "r15");

    dtcontext->SegCs = GetRegister(frame, "cs");
    dtcontext->SegSs = GetRegister(frame, "ss");
    dtcontext->SegDs = GetRegister(frame, "ds");
    dtcontext->SegEs = GetRegister(frame, "es");
    dtcontext->SegFs = GetRegister(frame, "fs");
    dtcontext->SegGs = GetRegister(frame, "gs");
#elif DBG_TARGET_ARM
    dtcontext->Pc = frame.GetPC();
    dtcontext->Sp = frame.GetSP();
    dtcontext->Lr = GetRegister(frame, "lr");
    dtcontext->Cpsr = GetRegister(frame, "cpsr");

    dtcontext->R0 = GetRegister(frame, "r0");
    dtcontext->R1 = GetRegister(frame, "r1");
    dtcontext->R2 = GetRegister(frame, "r2");
    dtcontext->R3 = GetRegister(frame, "r3");
    dtcontext->R4 = GetRegister(frame, "r4");
    dtcontext->R5 = GetRegister(frame, "r5");
    dtcontext->R6 = GetRegister(frame, "r6");
    dtcontext->R7 = GetRegister(frame, "r7");
    dtcontext->R8 = GetRegister(frame, "r8");
    dtcontext->R9 = GetRegister(frame, "r9");
    dtcontext->R10 = GetRegister(frame, "r10");
    dtcontext->R11 = GetRegister(frame, "r11");
    dtcontext->R12 = GetRegister(frame, "r12");
#endif
}
开发者ID:kouvel,项目名称:coreclr,代码行数:54,代码来源:services.cpp

示例3: MIunused

//++ ------------------------------------------------------------------------------------
// Details: Carry out work to complete the GDB show option 'language' to prepare
//          and send back the requested information.
// Type:    Method.
// Args:    vrWords - (R) List of additional parameters used by this option.
// Return:  MIstatus::success - Function succeeded.
//          MIstatus::failure - Function failed.
// Throws:  None.
//--
bool
CMICmdCmdGdbShow::OptionFnLanguage(const CMIUtilString::VecString_t &vrWords)
{
    MIunused(vrWords);

    // Get current language
    CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
    lldb::SBThread sbThread = rSessionInfo.GetProcess().GetSelectedThread();
    const lldb::SBFrame sbFrame = sbThread.GetSelectedFrame();
    lldb::SBCompileUnit sbCompileUnit = sbFrame.GetCompileUnit();
    const lldb::LanguageType eLanguageType = sbCompileUnit.GetLanguage();

    m_strValue = lldb::SBLanguageRuntime::GetNameForLanguageType(eLanguageType);
    return MIstatus::success;
}
开发者ID:RichardsonAlex,项目名称:lldb,代码行数:24,代码来源:MICmdCmdGdbShow.cpp

示例4: frame_sp

bool
SBInstruction::EmulateWithFrame (lldb::SBFrame &frame, uint32_t evaluate_options)
{
    if (m_opaque_sp)
    {
        lldb::StackFrameSP frame_sp (frame.GetFrameSP());

        if (frame_sp)
        {
            lldb_private::ExecutionContext exe_ctx;
            frame_sp->CalculateExecutionContext (exe_ctx);
            lldb_private::Target *target = exe_ctx.GetTargetPtr();
            lldb_private::ArchSpec arch = target->GetArchitecture();
            
            return m_opaque_sp->Emulate (arch, 
                                         evaluate_options,
                                         (void *) frame_sp.get(), 
                                         &lldb_private::EmulateInstruction::ReadMemoryFrame,
                                         &lldb_private::EmulateInstruction::WriteMemoryFrame,
                                         &lldb_private::EmulateInstruction::ReadRegisterFrame,
                                         &lldb_private::EmulateInstruction::WriteRegisterFrame);
        }
    }
    return false;
}
开发者ID:CODECOMMUNITY,项目名称:lldb,代码行数:25,代码来源:SBInstruction.cpp

示例5: frame_sp

lldb::SBValueList
SBBlock::GetVariables (lldb::SBFrame& frame,
                       bool arguments,
                       bool locals,
                       bool statics,
                       lldb::DynamicValueType use_dynamic)
{
    Block *block = GetPtr();
    SBValueList value_list;
    if (block)
    {
        StackFrameSP frame_sp(frame.GetFrameSP());
        VariableListSP variable_list_sp (block->GetBlockVariableList (true));

        if (variable_list_sp)
        {
            const size_t num_variables = variable_list_sp->GetSize();
            if (num_variables)
            {
                for (size_t i = 0; i < num_variables; ++i)
                {
                    VariableSP variable_sp (variable_list_sp->GetVariableAtIndex(i));
                    if (variable_sp)
                    {
                        bool add_variable = false;
                        switch (variable_sp->GetScope())
                        {
                            case eValueTypeVariableGlobal:
                            case eValueTypeVariableStatic:
                                add_variable = statics;
                                break;
                                
                            case eValueTypeVariableArgument:
                                add_variable = arguments;
                                break;
                                
                            case eValueTypeVariableLocal:
                                add_variable = locals;
                                break;
                                
                            default:
                                break;
                        }
                        if (add_variable)
                        {
                            if (frame_sp)
                            {
                                lldb::ValueObjectSP valobj_sp(frame_sp->GetValueObjectForFrameVariable (variable_sp,eNoDynamicValues));
                                SBValue value_sb;
                                value_sb.SetSP(valobj_sp, use_dynamic);
                                value_list.Append (value_sb);
                            }
                        }
                    }
                }
            }
        }        
    }
    return value_list;
}
开发者ID:2asoft,项目名称:freebsd,代码行数:60,代码来源:SBBlock.cpp

示例6: StepOutOfFrame

void SBThread::StepOutOfFrame(lldb::SBFrame &sb_frame) {
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));

  std::unique_lock<std::recursive_mutex> lock;
  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);

  if (!sb_frame.IsValid()) {
    if (log)
      log->Printf(
          "SBThread(%p)::StepOutOfFrame passed an invalid frame, returning.",
          static_cast<void *>(exe_ctx.GetThreadPtr()));
    return;
  }

  StackFrameSP frame_sp(sb_frame.GetFrameSP());
  if (log) {
    SBStream frame_desc_strm;
    sb_frame.GetDescription(frame_desc_strm);
    log->Printf("SBThread(%p)::StepOutOfFrame (frame = SBFrame(%p): %s)",
                static_cast<void *>(exe_ctx.GetThreadPtr()),
                static_cast<void *>(frame_sp.get()), frame_desc_strm.GetData());
  }

  if (exe_ctx.HasThreadScope()) {
    bool abort_other_plans = false;
    bool stop_other_threads = false;
    Thread *thread = exe_ctx.GetThreadPtr();
    if (sb_frame.GetThread().GetThreadID() != thread->GetID()) {
      log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from another "
                  "thread (0x%" PRIx64 " vrs. 0x%" PRIx64 ", returning.",
                  static_cast<void *>(exe_ctx.GetThreadPtr()),
                  sb_frame.GetThread().GetThreadID(), thread->GetID());
    }

    ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
        abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
        eVoteNoOpinion, frame_sp->GetFrameIndex()));

    // This returns an error, we should use it!
    ResumeNewPlan(exe_ctx, new_plan_sp.get());
  }
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:42,代码来源:SBThread.cpp

示例7:

// Internal function
DWORD_PTR 
LLDBServices::GetRegister(
    /* const */ lldb::SBFrame& frame,
    const char *name)
{
    lldb::SBValue regValue = frame.FindRegister(name);

    lldb::SBError error;
    DWORD_PTR result = regValue.GetValueAsUnsigned(error);

    return result;
}
开发者ID:kouvel,项目名称:coreclr,代码行数:13,代码来源:services.cpp

示例8: log

void
SBThread::StepOutOfFrame (lldb::SBFrame &sb_frame)
{
    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));

    if (log)
    {
        SBStream frame_desc_strm;
        sb_frame.GetDescription (frame_desc_strm);
        log->Printf ("SBThread(%p)::StepOutOfFrame (frame = SBFrame(%p): %s)", m_opaque_sp.get(), sb_frame.get(), frame_desc_strm.GetData());
    }

    if (m_opaque_sp)
    {
        Mutex::Locker api_locker (m_opaque_sp->GetProcess().GetTarget().GetAPIMutex());
        bool abort_other_plans = true;
        bool stop_other_threads = true;

        m_opaque_sp->QueueThreadPlanForStepOut (abort_other_plans, 
                                                NULL, 
                                                false, 
                                                stop_other_threads, 
                                                eVoteYes, 
                                                eVoteNoOpinion,
                                                sb_frame->GetFrameIndex());
        
        Process &process = m_opaque_sp->GetProcess();
        process.GetThreadList().SetSelectedThreadByID (m_opaque_sp->GetID());
        Error error (process.Resume());
        if (error.Success())
        {
            // If we are doing synchronous mode, then wait for the
            // process to stop yet again!
            if (process.GetTarget().GetDebugger().GetAsyncExecution () == false)
                process.WaitForProcessToStop (NULL);
        }
    }
}
开发者ID:fbsd,项目名称:old_lldb,代码行数:38,代码来源:SBThread.cpp

示例9: ExecutionContextRef

SBExecutionContext::SBExecutionContext (const lldb::SBFrame &frame) :
m_exe_ctx_sp(new ExecutionContextRef())
{
    m_exe_ctx_sp->SetFrameSP(frame.GetFrameSP());
}
开发者ID:2asoft,项目名称:freebsd,代码行数:5,代码来源:SBExecutionContext.cpp


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