17#include "llvm/Support/Casting.h"
25 m_opaque_up = std::make_unique<TypeSummaryOptions>();
39 return this->
operator bool();
41SBTypeSummaryOptions::operator
bool()
const {
110 if (!data || data[0] == 0)
121 if (!data || data[0] == 0)
132 if (!data || data[0] == 0)
143 if (!data || data[0] == 0)
152 const char *description) {
164 if (!cb(sb_value, options, stream))
166 llvm::StringRef sdata = stream.
GetString();
167 stm.
Write(sdata.data(), sdata.size());
170 description ? description :
"callback summary formatter")));
185 return this->
operator bool();
187SBTypeSummary::operator
bool()
const {
199 llvm::dyn_cast<ScriptSummaryFormat>(
m_opaque_sp.get())) {
200 const char *ftext = script_summary_ptr->GetPythonScript();
201 return (ftext && *ftext != 0);
212 llvm::dyn_cast<ScriptSummaryFormat>(
m_opaque_sp.get())) {
213 const char *ftext = script_summary_ptr->GetPythonScript();
214 return (!ftext || *ftext == 0);
234 llvm::dyn_cast<ScriptSummaryFormat>(
m_opaque_sp.get())) {
235 const char *fname = script_summary_ptr->GetFunctionName();
236 const char *ftext = script_summary_ptr->GetPythonScript();
241 llvm::dyn_cast<StringSummaryFormat>(
m_opaque_sp.get()))
243 string_summary_ptr->GetSummaryString());
260 return m_opaque_sp->SetPtrMatchDepth(ptr_match_depth);
267 return lldb::eTypeOptionNone;
284 if (!llvm::isa<StringSummaryFormat>(
m_opaque_sp.get()))
287 llvm::dyn_cast<StringSummaryFormat>(
m_opaque_sp.get()))
288 string_summary_ptr->SetSummaryString(data);
296 if (!llvm::isa<ScriptSummaryFormat>(
m_opaque_sp.get()))
299 llvm::dyn_cast<ScriptSummaryFormat>(
m_opaque_sp.get()))
300 script_summary_ptr->SetFunctionName(data);
308 if (!llvm::isa<ScriptSummaryFormat>(
m_opaque_sp.get()))
311 llvm::dyn_cast<ScriptSummaryFormat>(
m_opaque_sp.get()))
312 script_summary_ptr->SetPythonScript(data);
322 description.Printf(
"%s\n",
m_opaque_sp->GetDescription().c_str());
333 return m_opaque_sp->DoesPrintValue(value_sp.get());
374 return llvm::dyn_cast<CXXFunctionSummaryFormat>(
m_opaque_sp.get()) ==
375 llvm::dyn_cast<CXXFunctionSummaryFormat>(rhs.
m_opaque_sp.get());
391 llvm::dyn_cast<ScriptedSummaryFormat>(
m_opaque_sp.get());
393 llvm::dyn_cast<ScriptedSummaryFormat>(rhs.
m_opaque_sp.get());
394 if (!lhs_ptr || !rhs_ptr)
431 llvm::dyn_cast<CXXFunctionSummaryFormat>(
m_opaque_sp.get())) {
434 current_summary_ptr->m_description.c_str()));
436 llvm::dyn_cast<ScriptSummaryFormat>(
m_opaque_sp.get())) {
438 GetOptions(), current_summary_ptr->GetFunctionName(),
439 current_summary_ptr->GetPythonScript()));
441 llvm::dyn_cast<StringSummaryFormat>(
m_opaque_sp.get())) {
443 GetOptions(), current_summary_ptr->GetSummaryString()));
445 llvm::dyn_cast<ScriptedSummaryFormat>(
m_opaque_sp.get())) {
447 GetOptions(), current_summary_ptr->GetClassName()));
452 return nullptr != new_sp.get();
#define LLDB_INSTRUMENT_VA(...)
const char * GetString() const
Exists so friend classes can use the StringString's data without putting it in the ConstString pool.
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)
bool(* FormatCallback)(SBValue, SBTypeSummaryOptions, SBStream &)
void SetPtrMatchDepth(uint32_t ptr_match_depth)
void SetFunctionCode(const char *data)
static SBTypeSummary CreateWithClassName(const char *data, uint32_t options=0)
uint32_t GetPtrMatchDepth()
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 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.
const char * Intern(llvm::StringRef str) const
static StringPoolRef GetSystemPool()
The system pool. Only valid between Initialize and Terminate.
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.