bool SBTypeSummary::DoesPrintValue (lldb::SBValue value) { if (!IsValid()) return false; lldb::ValueObjectSP value_sp = value.GetSP(); return m_opaque_sp->DoesPrintValue(value_sp.get()); }
void LLDBVariable::DoInitFromLLDBValue(lldb::SBValue value) { SetName(value.GetName()); SetType(value.GetTypeName()); SetSummary(value.GetSummary()); SetValue(value.GetValue()); SetValueChanged(value.GetValueDidChange()); SetLldbId(value.GetID()); if(value.MightHaveChildren()) { m_hasChildren = true; } }
CMIUtilString CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory(lldb::SBValue &vrValue, const MIuint vnMaxLen) const { std::string result; lldb::addr_t addr = vrValue.GetLoadAddress(), end_addr = addr + vnMaxLen * sizeof(charT); lldb::SBProcess process = CMICmnLLDBDebugSessionInfo::Instance().GetProcess(); lldb::SBError error; while (addr < end_addr) { charT ch; const MIuint64 nReadBytes = process.ReadMemory(addr, &ch, sizeof(ch), error); if (error.Fail() || nReadBytes != sizeof(ch)) return m_pUnkwn; else if (ch == 0) break; result.append(CMIUtilString::ConvertToPrintableASCII(ch)); addr += sizeof(ch); } return result.c_str(); }
//++ ------------------------------------------------------------------------------------ // 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(), value.GetValue()); else if (type_code == lldb::eBasicTypeUnsignedChar) stream.Printf("%u %s", (unsigned)value.GetValueAsUnsigned(), value.GetValue()); else return false; return true; }