47 : m_flags(flags), m_kind(kind) {}
65 const char *format_cstr)
72 if (format_cstr && format_cstr[0]) {
84 retval.assign(
"NULL ValueObject");
98 assert(valobj &&
"Must have a valid ValueObject to summarize");
107 retval.assign(std::string(s.
GetString()));
110 retval.assign(
"error: summary string parsing error");
122 Cascades() ?
"" :
" (not cascading)",
128 HideNames(
nullptr) ?
" (hide member names)" :
"");
137 m_description(description ? description :
"") {}
152 sstr.
Printf(
"%s%s%s%s%s%s%s %s",
Cascades() ?
"" :
" (not cascading)",
158 HideNames(
nullptr) ?
" (hide member names)" :
"",
166 const char *function_name,
167 const char *python_script)
169 m_python_script(), m_script_function_sp() {
194 retval.assign(
"error: no target");
199 target_sp->GetDebugger().GetScriptInterpreter();
201 if (!script_interpreter) {
202 retval.assign(
"error: no ScriptInterpreter");
213 sstr.
Printf(
"%s%s%s%s%s%s%s\n ",
Cascades() ?
"" :
" (not cascading)",
219 HideNames(
nullptr) ?
" (hide member names)" :
"");
236 std::unique_ptr<llvm::MemoryBuffer> bytecode)
249 retval.assign(
"error: no target");
253 std::vector<FormatterBytecode::ControlStackElement> control(
257 control, data, FormatterBytecode::sel_summary);
259 retval = llvm::toString(std::move(
error));
263 retval =
"empty stack";
266 auto &top = data.back();
268 llvm::raw_string_ostream os(retval);
269 if (
auto s = std::get_if<std::string>(&top))
271 else if (
auto u = std::get_if<uint64_t>(&top))
273 else if (
auto i = std::get_if<int64_t>(&top))
275 else if (
auto valobj = std::get_if<ValueObjectSP>(&top)) {
277 os <<
"empty object";
280 }
else if (
auto type = std::get_if<CompilerType>(&top)) {
281 os << type->TypeDescription();
282 }
else if (
auto sel = std::get_if<FormatterBytecode::Selectors>(&top)) {
290 sstr.
Printf(
"%s%s%s%s%s%s%s\n ",
Cascades() ?
"" :
" (not cascading)",
296 HideNames(
nullptr) ?
" (hide member names)" :
"");
302 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 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.
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
void Clear()
Clear the object state.
bool Fail() const
Test for error condition.
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
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.
virtual bool DoesPrintValue(ValueObject *valobj) const
TypeSummaryImpl(Kind kind, const TypeSummaryImpl::Flags &flags)
bool SkipsPointers() const
virtual bool DoesPrintChildren(ValueObject *valobj) const
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.
const char * toString(AppleArm64ExceptionClass EC)
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.