Exemple #1
0
SBTarget
SBDebugger::CreateTargetWithFileAndArch (const char *filename, const char *arch_cstr)
{
    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));

    SBTarget target;
    if (m_opaque_sp)
    {
        FileSpec file (filename, true);
        TargetSP target_sp;
        Error error;
        const bool add_dependent_modules = true;

        error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, 
                                                           file, 
                                                           arch_cstr, 
                                                           add_dependent_modules, 
                                                           NULL, 
                                                           target_sp);

        if (error.Success())
        {
            m_opaque_sp->GetTargetList().SetSelectedTarget (target_sp.get());
            target.reset(target_sp);
        }
    }

    if (log)
    {
        log->Printf ("SBDebugger(%p)::CreateTargetWithFileAndArch (filename=\"%s\", arch=%s) => SBTarget(%p)", 
                     m_opaque_sp.get(), filename, arch_cstr, target.get());
    }

    return target;
}
Exemple #2
0
SBTarget
SBDebugger::CreateTarget (const char *filename)
{
    SBTarget target;
    if (m_opaque_sp)
    {
        FileSpec file (filename, true);
        ArchSpec arch = Target::GetDefaultArchitecture ();
        TargetSP target_sp;
        Error error;
        const bool add_dependent_modules = true;

        error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, 
                                                           file, 
                                                           arch, 
                                                           add_dependent_modules, 
                                                           m_opaque_sp->GetPlatformList().GetSelectedPlatform(),
                                                           target_sp);

        if (error.Success())
        {
            m_opaque_sp->GetTargetList().SetSelectedTarget (target_sp.get());
            target.reset (target_sp);
        }
    }
    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
    if (log)
    {
        log->Printf ("SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)", 
                     m_opaque_sp.get(), filename, target.get());
    }
    return target;
}
Exemple #3
0
SBTarget
SBDebugger::CreateTargetWithFileAndTargetTriple (const char *filename,
                                                 const char *target_triple)
{
    SBTarget target;
    if (m_opaque_sp)
    {
        FileSpec file_spec (filename, true);
        TargetSP target_sp;
        const bool add_dependent_modules = true;
        Error error (m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, 
                                                                file_spec, 
                                                                target_triple, 
                                                                add_dependent_modules, 
                                                                NULL,
                                                                target_sp));
        target.reset (target_sp);
    }
    
    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
    if (log)
    {
        log->Printf ("SBDebugger(%p)::CreateTargetWithFileAndTargetTriple (filename=\"%s\", triple=%s) => SBTarget(%p)", 
                     m_opaque_sp.get(), filename, target_triple, target.get());
    }

    return target;
}
Exemple #4
0
void
SBDebugger::SetSelectedTarget (SBTarget &sb_target)
{
    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));

    if (m_opaque_sp)
    {
        m_opaque_sp->GetTargetList().SetSelectedTarget (sb_target.get());
    }
    if (log)
    {
        SBStream sstr;
        sb_target.GetDescription (sstr, eDescriptionLevelBrief);
        log->Printf ("SBDebugger(%p)::SetSelectedTarget () => SBTarget(%p): %s", m_opaque_sp.get(),
                     sb_target.get(), sstr.GetData());
    }
}
Exemple #5
0
lldb::SBTarget
SBValue::GetTarget()
{
    SBTarget result;
    if (m_opaque_sp)
    {
        if (m_opaque_sp->GetUpdatePoint().GetTargetSP())
        {
            result = SBTarget(lldb::TargetSP(m_opaque_sp->GetUpdatePoint().GetTargetSP()));
        }
    }
    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
    if (log)
    {
        if (result.get() == NULL)
            log->Printf ("SBValue(%p)::GetTarget () => NULL", m_opaque_sp.get());
        else
            log->Printf ("SBValue(%p)::GetTarget () => %p", m_opaque_sp.get(), result.get());
    }
    return result;
}