16#include "llvm/Support/Casting.h"
24 m_opaque_up = std::make_unique<TypeSummaryOptions>();
38 return this->
operator bool();
40SBTypeSummaryOptions::operator bool()
const {
43 return m_opaque_up.get();
109 if (!data || data[0] == 0)
120 if (!data || data[0] == 0)
131 if (!data || data[0] == 0)
140 const char *description) {
152 if (!cb(sb_value, options, stream))
157 description ? description :
"callback summary formatter")));
164 : m_opaque_sp(rhs.m_opaque_sp) {
172 return this->
operator bool();
174SBTypeSummary::operator bool()
const {
177 return m_opaque_sp.get() !=
nullptr;
186 llvm::dyn_cast<ScriptSummaryFormat>(
m_opaque_sp.get())) {
187 const char *ftext = script_summary_ptr->GetPythonScript();
188 return (ftext && *ftext != 0);
199 llvm::dyn_cast<ScriptSummaryFormat>(
m_opaque_sp.get())) {
200 const char *ftext = script_summary_ptr->GetPythonScript();
201 return (!ftext || *ftext == 0);
212 return m_opaque_sp->GetKind() == TypeSummaryImpl::Kind::eSummaryString;
221 llvm::dyn_cast<ScriptSummaryFormat>(
m_opaque_sp.get())) {
222 const char *fname = script_summary_ptr->GetFunctionName();
223 const char *ftext = script_summary_ptr->GetPythonScript();
228 llvm::dyn_cast<StringSummaryFormat>(
m_opaque_sp.get()))
237 return lldb::eTypeOptionNone;
254 if (!llvm::isa<StringSummaryFormat>(
m_opaque_sp.get()))
257 llvm::dyn_cast<StringSummaryFormat>(
m_opaque_sp.get()))
258 string_summary_ptr->SetSummaryString(data);
266 if (!llvm::isa<ScriptSummaryFormat>(
m_opaque_sp.get()))
269 llvm::dyn_cast<ScriptSummaryFormat>(
m_opaque_sp.get()))
270 script_summary_ptr->SetFunctionName(data);
278 if (!llvm::isa<ScriptSummaryFormat>(
m_opaque_sp.get()))
281 llvm::dyn_cast<ScriptSummaryFormat>(
m_opaque_sp.get()))
282 script_summary_ptr->SetPythonScript(data);
292 description.Printf(
"%s\n",
m_opaque_sp->GetDescription().c_str());
303 return m_opaque_sp->DoesPrintValue(value_sp.get());
343 case TypeSummaryImpl::Kind::eCallback:
344 return llvm::dyn_cast<CXXFunctionSummaryFormat>(
m_opaque_sp.get()) ==
345 llvm::dyn_cast<CXXFunctionSummaryFormat>(rhs.
m_opaque_sp.get());
346 case TypeSummaryImpl::Kind::eScript:
352 case TypeSummaryImpl::Kind::eSummaryString:
356 case TypeSummaryImpl::Kind::eInternal:
378 : m_opaque_sp(typesummary_impl_sp) {}
390 llvm::dyn_cast<CXXFunctionSummaryFormat>(
m_opaque_sp.get())) {
393 current_summary_ptr->m_description.c_str()));
395 llvm::dyn_cast<ScriptSummaryFormat>(
m_opaque_sp.get())) {
397 GetOptions(), current_summary_ptr->GetFunctionName(),
398 current_summary_ptr->GetPythonScript()));
400 llvm::dyn_cast<StringSummaryFormat>(
m_opaque_sp.get())) {
402 GetOptions(), current_summary_ptr->GetSummaryString()));
407 return nullptr != new_sp.get();
417 (
m_opaque_sp->GetKind() == TypeSummaryImpl::Kind::eScript)) {
#define LLDB_INSTRUMENT_VA(...)
lldb::LanguageType GetLanguage()
void SetLanguage(lldb::LanguageType)
lldb_private::TypeSummaryOptions & ref()
lldb::TypeSummaryCapping GetCapping()
void SetCapping(lldb::TypeSummaryCapping)
std::unique_ptr< lldb_private::TypeSummaryOptions > m_opaque_up
lldb_private::TypeSummaryOptions * get()
lldb_private::TypeSummaryOptions * operator->()
static SBTypeSummary CreateWithFunctionName(const char *data, uint32_t options=0)
void SetSummaryString(const char *data)
void SetOptions(uint32_t)
lldb::SBTypeSummary & operator=(const lldb::SBTypeSummary &rhs)
static SBTypeSummary CreateWithCallback(FormatCallback cb, uint32_t options=0, const char *description=nullptr)
static SBTypeSummary CreateWithSummaryString(const char *data, uint32_t options=0)
bool operator==(lldb::SBTypeSummary &rhs)
bool ChangeSummaryType(bool want_script)
void SetSP(const lldb::TypeSummaryImplSP &typefilter_impl_sp)
void SetFunctionCode(const char *data)
static SBTypeSummary CreateWithScriptCode(const char *data, uint32_t options=0)
bool operator!=(lldb::SBTypeSummary &rhs)
bool IsEqualTo(lldb::SBTypeSummary &rhs)
lldb::TypeSummaryImplSP m_opaque_sp
bool DoesPrintValue(lldb::SBValue value)
void SetFunctionName(const char *data)
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
lldb::TypeSummaryImplSP GetSP()
lldb::ValueObjectSP GetSP() const
Same as the protected version of GetSP that takes a locker, except that we make the locker locally in...
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
A stream class that can stream formatted output to a file.
size_t Write(const void *src, size_t src_len)
Output character bytes to the stream.
lldb::ValueObjectSP GetSP()
A class that represents a running process on the host machine.
std::unique_ptr< T > clone(const std::unique_ptr< T > &src)
TypeSummaryCapping
Whether a summary should cap how much data it returns to users or not.
std::shared_ptr< lldb_private::TypeSummaryImpl > TypeSummaryImplSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.