50 uint32_t ptr_match_depth)
66 return "python class";
68 llvm_unreachable(
"Unknown type kind name");
72 const char *format_cstr,
73 uint32_t ptr_match_depth)
81 if (format_cstr && format_cstr[0]) {
93 retval.assign(
"NULL ValueObject");
107 assert(valobj &&
"Must have a valid ValueObject to summarize");
116 retval.assign(std::string(s.
GetString()));
119 retval.assign(
"error: summary string parsing error");
129 m_error.Fail() ?
" error: " :
"",
131 Cascades() ?
"" :
" (not cascading)",
137 HideNames(
nullptr) ?
" (hide member names)" :
"",
146 uint32_t ptr_match_depth)
163 sstr.
Printf(
"%s%s%s%s%s%s%s ptr-match-depth=%u %s",
164 Cascades() ?
"" :
" (not cascading)",
170 HideNames(
nullptr) ?
" (hide member names)" :
"",
178 const char *function_name,
179 const char *python_script,
180 uint32_t ptr_match_depth)
207 retval.assign(
"error: no target");
212 target_sp->GetDebugger().GetScriptInterpreter();
214 if (!script_interpreter) {
215 retval.assign(
"error: no ScriptInterpreter");
226 sstr.
Printf(
"%s%s%s%s%s%s%s ptr-match-depth=%u\n ",
227 Cascades() ?
"" :
" (not cascading)",
233 HideNames(
nullptr) ?
" (hide member names)" :
"",
251 uint32_t ptr_match_depth)
264 retval.assign(
"error: no target");
269 target_sp->GetDebugger().GetScriptInterpreter();
271 if (!script_interpreter) {
272 retval.assign(
"error: no ScriptInterpreter");
279 retval.assign(
"error: no ScriptedStringSummaryInterface");
283 llvm::Expected<StructuredData::GenericSP> obj_or_err =
286 retval.assign(llvm::toString(obj_or_err.takeError()));
292 llvm::Expected<std::string> summary =
295 retval.assign(llvm::toString(summary.takeError()));
299 retval = std::move(*summary);
305 sstr.
Printf(
"%s%s%s%s%s%s%s ptr-match-depth=%u\n ",
306 Cascades() ?
"" :
" (not cascading)",
312 HideNames(
nullptr) ?
" (hide member names)" :
"",
322 std::unique_ptr<llvm::MemoryBuffer> bytecode)
335 retval.assign(
"error: no target");
342 control, data, FormatterBytecode::sig_summary);
344 retval = llvm::toString(std::move(
error));
348 retval =
"empty stack";
351 auto &top = data.back();
353 llvm::raw_string_ostream os(retval);
354 if (
auto s = std::get_if<std::string>(&top))
356 else if (
auto u = std::get_if<uint64_t>(&top))
358 else if (
auto i = std::get_if<int64_t>(&top))
360 else if (
auto valobj = std::get_if<ValueObjectSP>(&top)) {
362 os <<
"empty object";
365 }
else if (
auto type = std::get_if<CompilerType>(&top)) {
366 os << type->TypeDescription();
367 }
else if (
auto sel = std::get_if<FormatterBytecode::Selectors>(&top)) {
375 sstr.
Printf(
"%s%s%s%s%s%s%s\n ",
Cascades() ?
"" :
" (not cascading)",
381 HideNames(
nullptr) ?
" (hide member names)" :
"");
387 return "LLDB bytecode formatter";
static llvm::raw_ostream & error(Stream &strm)
Address & GetBaseAddress()
Get accessor for the base address of the range.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
virtual lldb::ScriptedStringSummaryInterfaceSP CreateScriptedStringSummaryInterface()
virtual bool GetScriptedSummary(const char *function_name, lldb::ValueObjectSP valobj, StructuredData::ObjectSP &callee_wrapper_sp, const TypeSummaryOptions &options, std::string &retval)
This base class provides an interface to stack frames.
virtual const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
llvm::StringRef GetString() const
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Defines a symbol context baton that can be handed other debug core functions.
LineEntry line_entry
The LineEntry for a given query.
virtual bool HideNames(ValueObject *valobj) const
virtual std::string GetSummaryKindName()
Get the name of the kind of Summary Provider, either c++, summary string, script or python.
uint32_t m_ptr_match_depth
TypeSummaryImpl(Kind kind, const TypeSummaryImpl::Flags &flags, uint32_t ptr_match_depth=1)
virtual bool DoesPrintValue(ValueObject *valobj) const
bool SkipsPointers() const
virtual bool DoesPrintChildren(ValueObject *valobj) const
uint32_t GetPtrMatchDepth()
bool SkipsReferences() const
lldb::TypeSummaryCapping m_capping
lldb::LanguageType GetLanguage() const
TypeSummaryOptions & SetCapping(lldb::TypeSummaryCapping)
lldb::LanguageType m_lang
TypeSummaryOptions & SetLanguage(lldb::LanguageType)
lldb::TypeSummaryCapping GetCapping() const
bool PrintChildrenOneLiner(bool hide_names)
lldb::ValueObjectSP GetSP()
lldb::TargetSP GetTargetSP() const
virtual const char * GetValueAsCString()
const ExecutionContextRef & GetExecutionContextRef() const
A class that represents a running process on the host machine.
std::string toString(FormatterBytecode::OpCodes op)
TypeSummaryCapping
Whether a summary should cap how much data it returns to users or not.
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Target > TargetSP
AddressRange range
The section offset address range for this line entry.