Exemplo n.º 1
0
bool
SBTypeFormat::GetDescription (lldb::SBStream &description, 
                              lldb::DescriptionLevel description_level)
{
    if (!IsValid())
        return false;
    else {
        description.Printf("%s\n",
                           m_opaque_sp->GetDescription().c_str());
        return true;
    }
}
Exemplo n.º 2
0
bool
SBTypeSummary::GetDescription (lldb::SBStream &description, 
                              lldb::DescriptionLevel description_level)
{
    if (!CopyOnWrite_Impl())
        return false;
    else {
        description.Printf("%s\n",
                           m_opaque_sp->GetDescription().c_str());
        return true;
    }
}
Exemplo n.º 3
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;
}
Exemplo n.º 4
0
bool SBTypeFilter::GetDescription(lldb::SBStream &description,
                                  lldb::DescriptionLevel description_level) {
  LLDB_RECORD_METHOD(bool, SBTypeFilter, GetDescription,
                     (lldb::SBStream &, lldb::DescriptionLevel), description,
                     description_level);

  if (!IsValid())
    return false;
  else {
    description.Printf("%s\n", m_opaque_sp->GetDescription().c_str());
    return true;
  }
}
Exemplo n.º 5
0
//++
// MI private summary providers
static inline bool MI_char_summary_provider(lldb::SBValue value,
                                            lldb::SBTypeSummaryOptions options,
                                            lldb::SBStream &stream) {
  if (!value.IsValid())
    return false;

  lldb::SBType value_type = value.GetType();
  if (!value_type.IsValid())
    return false;

  lldb::BasicType type_code = value_type.GetBasicType();
  if (type_code == lldb::eBasicTypeSignedChar)
    stream.Printf("%d %s", (int)value.GetValueAsSigned(),
                  CMIUtilString::WithNullAsEmpty(value.GetValue()));
  else if (type_code == lldb::eBasicTypeUnsignedChar)
    stream.Printf("%u %s", (unsigned)value.GetValueAsUnsigned(),
                  CMIUtilString::WithNullAsEmpty(value.GetValue()));
  else
    return false;

  return true;
}
Exemplo n.º 6
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;
}
Exemplo n.º 7
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;
}
Exemplo n.º 8
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;
}
Exemplo n.º 9
0
bool SBModuleSpec::GetDescription(lldb::SBStream &description) {
  m_opaque_ap->Dump(description.ref());
  return true;
}