Example #1
0
bool
SBInstructionList::GetDescription (lldb::SBStream &description)
{
    if (m_opaque_sp)
    {
        size_t num_instructions = GetSize ();
        if (num_instructions)
        {
            // Call the ref() to make sure a stream is created if one deesn't 
            // exist already inside description...
            Stream &sref = description.ref();
            const uint32_t max_opcode_byte_size = m_opaque_sp->GetInstructionList().GetMaxOpcocdeByteSize();
            for (size_t i=0; i<num_instructions; ++i)
            {
                Instruction *inst = m_opaque_sp->GetInstructionList().GetInstructionAtIndex (i).get();
                if (inst == NULL)
                    break;
                inst->Dump (&sref, max_opcode_byte_size, true, false, NULL, false);
                sref.EOL();
            }
            return true;
        }
    }
    return false;
}
Example #2
0
bool
SBTypeMember::GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level)
{
    Stream &strm = description.ref();

    if (m_opaque_ap.get())
    {
        const uint32_t bit_offset = m_opaque_ap->GetBitOffset();
        const uint32_t byte_offset = bit_offset / 8u;
        const uint32_t byte_bit_offset = bit_offset % 8u;
        const char *name = m_opaque_ap->GetName().GetCString();
        if (byte_bit_offset)
            strm.Printf ("+%u + %u bits: (", byte_offset, byte_bit_offset);
        else
            strm.Printf ("+%u: (", byte_offset);
        
        TypeImplSP type_impl_sp (m_opaque_ap->GetTypeImpl());
        if (type_impl_sp)
            type_impl_sp->GetDescription(strm, description_level);
        
        strm.Printf (") %s", name);
        if (m_opaque_ap->GetIsBitfield())
        {
            const uint32_t bitfield_bit_size = m_opaque_ap->GetBitfieldBitSize();
            strm.Printf (" : %u", bitfield_bit_size);
        }
    }
    else
    {
        strm.PutCString ("No value");
    }
    return true;   
}
Example #3
0
bool
SBTypeMemberFunction::GetDescription (lldb::SBStream &description,
                                      lldb::DescriptionLevel description_level)
{
    Stream &strm = description.ref();
    
    if (m_opaque_sp)
        return m_opaque_sp->GetDescription(strm);
    
    return false;
}
Example #4
0
bool SBData::GetDescription(lldb::SBStream &description,
                            lldb::addr_t base_addr) {
  Stream &strm = description.ref();

  if (m_opaque_sp) {
    DumpDataExtractor(*m_opaque_sp, &strm, 0, lldb::eFormatBytesWithASCII, 1,
                      m_opaque_sp->GetByteSize(), 16, base_addr, 0, 0);
  } else
    strm.PutCString("No value");

  return true;
}
Example #5
0
bool SBThread::GetStopReasonExtendedInfoAsJSON(lldb::SBStream &stream) {
  Stream &strm = stream.ref();

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

  if (!exe_ctx.HasThreadScope())
    return false;

  StopInfoSP stop_info = exe_ctx.GetThreadPtr()->GetStopInfo();
  StructuredData::ObjectSP info = stop_info->GetExtendedInfo();
  if (!info)
    return false;

  info->Dump(strm);

  return true;
}
Example #6
0
bool
SBInstruction::GetDescription (lldb::SBStream &s)
{
    if (m_opaque_sp)
    {
        SymbolContext sc;
        const Address &addr = m_opaque_sp->GetAddress();
        ModuleSP module_sp (addr.GetModule());
        if (module_sp)
            module_sp->ResolveSymbolContextForAddress(addr, eSymbolContextEverything, sc);
        // Use the "ref()" instead of the "get()" accessor in case the SBStream 
        // didn't have a stream already created, one will get created...
        FormatEntity::Entry format;
        FormatEntity::Parse("${addr}: ", format);
        m_opaque_sp->Dump (&s.ref(), 0, true, false, NULL, &sc, NULL, &format, 0);
        return true;
    }
    return false;
}
Example #7
0
bool SBInstructionList::GetDescription(lldb::SBStream &description) {
    if (m_opaque_sp) {
        size_t num_instructions = GetSize();
        if (num_instructions) {
            // Call the ref() to make sure a stream is created if one deesn't
            // exist already inside description...
            Stream &sref = description.ref();
            const uint32_t max_opcode_byte_size =
                m_opaque_sp->GetInstructionList().GetMaxOpcocdeByteSize();
            FormatEntity::Entry format;
            FormatEntity::Parse("${addr}: ", format);
            SymbolContext sc;
            SymbolContext prev_sc;
            for (size_t i = 0; i < num_instructions; ++i) {
                Instruction *inst =
                    m_opaque_sp->GetInstructionList().GetInstructionAtIndex(i).get();
                if (inst == NULL)
                    break;

                const Address &addr = inst->GetAddress();
                prev_sc = sc;
                ModuleSP module_sp(addr.GetModule());
                if (module_sp) {
                    module_sp->ResolveSymbolContextForAddress(
                        addr, eSymbolContextEverything, sc);
                }

                inst->Dump(&sref, max_opcode_byte_size, true, false, NULL, &sc,
                           &prev_sc, &format, 0);
                sref.EOL();
            }
            return true;
        }
    }
    return false;
}
Example #8
0
bool SBModuleSpec::GetDescription(lldb::SBStream &description) {
  m_opaque_ap->Dump(description.ref());
  return true;
}