LLDB mainline
ValueObjectPrinter.cpp
Go to the documentation of this file.
1//===-- ValueObjectPrinter.cpp --------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10
15#include "lldb/Target/Target.h"
16#include "lldb/Utility/Stream.h"
17
18using namespace lldb;
19using namespace lldb_private;
20
22 if (valobj) {
23 DumpValueObjectOptions options(*valobj);
24 Init(valobj, s, options, m_options.m_max_ptr_depth, 0, nullptr);
25 } else {
27 Init(valobj, s, options, m_options.m_max_ptr_depth, 0, nullptr);
28 }
29}
30
32 const DumpValueObjectOptions &options) {
33 Init(valobj, s, options, m_options.m_max_ptr_depth, 0, nullptr);
34}
35
37 ValueObject *valobj, Stream *s, const DumpValueObjectOptions &options,
38 const DumpValueObjectOptions::PointerDepth &ptr_depth, uint32_t curr_depth,
39 InstancePointersSetSP printed_instance_pointers) {
40 Init(valobj, s, options, ptr_depth, curr_depth, printed_instance_pointers);
41}
42
44 ValueObject *valobj, Stream *s, const DumpValueObjectOptions &options,
45 const DumpValueObjectOptions::PointerDepth &ptr_depth, uint32_t curr_depth,
46 InstancePointersSetSP printed_instance_pointers) {
47 m_orig_valobj = valobj;
48 m_valobj = nullptr;
49 m_stream = s;
50 m_options = options;
51 m_ptr_depth = ptr_depth;
52 m_curr_depth = curr_depth;
53 assert(m_orig_valobj && "cannot print a NULL ValueObject");
54 assert(m_stream && "cannot print to a NULL Stream");
62 m_summary_formatter = {nullptr, false};
63 m_value.assign("");
64 m_summary.assign("");
65 m_error.assign("");
66 m_val_summary_ok = false;
68 printed_instance_pointers
69 ? printed_instance_pointers
71}
72
74 if (!m_orig_valobj)
75 return false;
76
77 // If the incoming ValueObject is in an error state, the best we're going to
78 // get out of it is its type. But if we don't even have that, just print
79 // the error and exit early.
82 m_stream->Printf("Error: '%s'", m_orig_valobj->GetError().AsCString());
83 return true;
84 }
85
86 if (!GetMostSpecializedValue() || m_valobj == nullptr)
87 return false;
88
92
93 PrintDecl();
94 }
95
96 bool value_printed = false;
97 bool summary_printed = false;
98
100 PrintValueAndSummaryIfNeeded(value_printed, summary_printed);
101
103 PrintChildrenIfNeeded(value_printed, summary_printed);
104 else
105 m_stream->EOL();
106
107 return true;
108}
109
111 if (m_valobj)
112 return true;
113 bool update_success = m_orig_valobj->UpdateValueIfNeeded(true);
114 if (!update_success) {
116 } else {
117 if (m_orig_valobj->IsDynamic()) {
119 ValueObject *static_value = m_orig_valobj->GetStaticValue().get();
120 if (static_value)
121 m_valobj = static_value;
122 else
124 } else
126 } else {
128 ValueObject *dynamic_value =
130 if (dynamic_value)
131 m_valobj = dynamic_value;
132 else
134 } else
136 }
137
138 if (m_valobj->IsSynthetic()) {
140 ValueObject *non_synthetic = m_valobj->GetNonSyntheticValue().get();
141 if (non_synthetic)
142 m_valobj = non_synthetic;
143 }
144 } else {
146 ValueObject *synthetic = m_valobj->GetSyntheticValue().get();
147 if (synthetic)
148 m_valobj = synthetic;
149 }
150 }
151 }
154 return true;
155}
156
158 const char *str = m_valobj->GetObjectDescription();
159 if (!str)
161 if (!str)
163 return str;
164}
165
167 const char *root_valobj_name = m_options.m_root_valobj_name.empty()
170 return root_valobj_name ? root_valobj_name : "";
171}
172
176 (!m_options.m_flat_output || m_type_flags.Test(eTypeHasValue))
178 : eLazyBoolNo;
180}
181
185 return m_is_nil == eLazyBoolYes;
186}
187
192 return m_is_uninit == eLazyBoolYes;
193}
194
197 m_is_ptr = m_type_flags.Test(eTypeIsPointer) ? eLazyBoolYes : eLazyBoolNo;
198 return m_is_ptr == eLazyBoolYes;
199}
200
203 m_is_ref = m_type_flags.Test(eTypeIsReference) ? eLazyBoolYes : eLazyBoolNo;
204 return m_is_ref == eLazyBoolYes;
205}
206
210 m_type_flags.Test(eTypeHasChildren) ? eLazyBoolYes : eLazyBoolNo;
212}
213
215 // you need to do this check on the value's clang type
218 eTypeInstanceIsPointer) != 0
220 : eLazyBoolNo;
224}
225
229 return true;
230 }
231 return false;
232}
233
235 bool show_type = true;
236 // if we are at the root-level and been asked to hide the root's type, then
237 // hide it
239 show_type = false;
240 else
241 // otherwise decide according to the usual rules (asked to show types -
242 // always at the root level)
243 show_type = m_options.m_show_types ||
245
246 StreamString typeName;
247
248 // always show the type at the root level if it is invalid
249 if (show_type) {
250 // Some ValueObjects don't have types (like registers sets). Only print the
251 // type if there is one to print
252 ConstString type_name;
253 if (m_compiler_type.IsValid()) {
257 } else {
258 // only show an invalid type name if the user explicitly triggered
259 // show_type
261 type_name = ConstString("<invalid type>");
262 }
263
264 if (type_name) {
265 std::string type_name_str(type_name.GetCString());
267 for (auto iter = type_name_str.find(" *"); iter != std::string::npos;
268 iter = type_name_str.find(" *")) {
269 type_name_str.erase(iter, 2);
270 }
271 }
272 typeName << type_name_str.c_str();
273 }
274 }
275
276 StreamString varName;
277
278 if (ShouldShowName()) {
280 m_valobj->GetExpressionPath(varName);
281 else
282 varName << GetRootNameForDisplay();
283 }
284
285 bool decl_printed = false;
287 // if the user didn't give us a custom helper, pick one based upon the
288 // language, either the one that this printer is bound to, or the preferred
289 // one for the ValueObject
290 lldb::LanguageType lang_type =
294 if (Language *lang_plugin = Language::FindPlugin(lang_type)) {
295 m_options.m_decl_printing_helper = lang_plugin->GetDeclPrintingHelper();
296 }
297 }
298
300 ConstString type_name_cstr(typeName.GetString());
301 ConstString var_name_cstr(varName.GetString());
302
303 DumpValueObjectOptions decl_print_options = m_options;
304 // Pass printing helpers an option object that indicates whether the name
305 // should be shown or hidden.
306 decl_print_options.SetHideName(!ShouldShowName());
307
308 StreamString dest_stream;
309 if (m_options.m_decl_printing_helper(type_name_cstr, var_name_cstr,
310 decl_print_options, dest_stream)) {
311 decl_printed = true;
312 m_stream->PutCString(dest_stream.GetString());
313 }
314 }
315
316 // if the helper failed, or there is none, do a default thing
317 if (!decl_printed) {
318 if (!typeName.Empty())
319 m_stream->Printf("(%s) ", typeName.GetData());
320 if (!varName.Empty())
321 m_stream->Printf("%s =", varName.GetData());
322 else if (ShouldShowName())
323 m_stream->Printf(" =");
324 }
325}
326
329 return true;
330 return m_valobj->IsInScope();
331}
332
334 if (!m_summary_formatter.second) {
336 ? m_options.m_summary_sp.get()
337 : m_valobj->GetSummaryFormat().get();
338
340 entry = nullptr;
341 m_summary_formatter.first = entry;
342 m_summary_formatter.second = true;
343 }
344 if (m_options.m_omit_summary_depth > 0 && null_if_omitted)
345 return nullptr;
346 return m_summary_formatter.first;
347}
348
349static bool IsPointerValue(const CompilerType &type) {
350 Flags type_flags(type.GetTypeInfo());
351 if (type_flags.AnySet(eTypeInstanceIsPointer | eTypeIsPointer))
352 return type_flags.AllClear(eTypeIsBuiltIn);
353 return false;
354}
355
357 std::string &summary,
358 std::string &error) {
360 // if I am printing synthetized elements, apply the format to those elements
361 // only
364 else if (format != eFormatDefault && format != m_valobj->GetFormat())
365 m_valobj->GetValueAsCString(format, value);
366 else {
367 const char *val_cstr = m_valobj->GetValueAsCString();
368 if (val_cstr)
369 value.assign(val_cstr);
370 }
371 const char *err_cstr = m_valobj->GetError().AsCString();
372 if (err_cstr)
373 error.assign(err_cstr);
374
376 return;
377
378 if (IsNil()) {
379 lldb::LanguageType lang_type =
383 if (Language *lang_plugin = Language::FindPlugin(lang_type)) {
384 summary.assign(lang_plugin->GetNilReferenceSummaryString().str());
385 } else {
386 // We treat C as the fallback language rather than as a separate Language
387 // plugin.
388 summary.assign("NULL");
389 }
390 } else if (IsUninitialized()) {
391 summary.assign("<uninitialized>");
392 } else if (m_options.m_omit_summary_depth == 0) {
394 if (entry) {
395 m_valobj->GetSummaryAsCString(entry, summary,
397 } else {
398 const char *sum_cstr =
400 if (sum_cstr)
401 summary.assign(sum_cstr);
402 }
403 }
404}
405
407 bool &summary_printed) {
408 bool error_printed = false;
410 if (!CheckScopeIfNeeded())
411 m_error.assign("out of scope");
412 if (m_error.empty()) {
414 }
415 if (m_error.size()) {
416 // we need to support scenarios in which it is actually fine for a value
417 // to have no type but - on the other hand - if we get an error *AND*
418 // have no type, we try to get out gracefully, since most often that
419 // combination means "could not resolve a type" and the default failure
420 // mode is quite ugly
421 if (!m_compiler_type.IsValid()) {
422 m_stream->Printf(" <could not resolve type>");
423 return false;
424 }
425
426 error_printed = true;
427 m_stream->Printf(" <%s>\n", m_error.c_str());
428 } else {
429 // Make sure we have a value and make sure the summary didn't specify
430 // that the value should not be printed - and do not print the value if
431 // this thing is nil (but show the value if the user passes a format
432 // explicitly)
434 const bool has_nil_or_uninitialized_summary =
435 (IsNil() || IsUninitialized()) && !m_summary.empty();
436 if (!has_nil_or_uninitialized_summary && !m_value.empty() &&
437 (entry == nullptr ||
438 (entry->DoesPrintValue(m_valobj) ||
440 m_summary.empty()) &&
444 } else {
445 if (ShouldShowName())
446 m_stream->PutChar(' ');
448 value_printed = true;
449 }
450 }
451
452 if (m_summary.size()) {
453 if (ShouldShowName() || value_printed)
454 m_stream->PutChar(' ');
456 summary_printed = true;
457 }
458 }
459 }
460 return !error_printed;
461}
462
464 bool summary_printed) {
466 // let's avoid the overly verbose no description error for a nil thing
467 if (m_options.m_use_objc && !IsNil() && !IsUninitialized() &&
470 m_stream->Printf(" ");
471 const char *object_desc = nullptr;
472 if (value_printed || summary_printed)
473 object_desc = m_valobj->GetObjectDescription();
474 else
475 object_desc = GetDescriptionForDisplay();
476 if (object_desc && *object_desc) {
477 // If the description already ends with a \n don't add another one.
478 size_t object_end = strlen(object_desc) - 1;
479 if (object_desc[object_end] == '\n')
480 m_stream->Printf("%s", object_desc);
481 else
482 m_stream->Printf("%s\n", object_desc);
483 return true;
484 } else if (!value_printed && !summary_printed)
485 return true;
486 else
487 return false;
488 }
489 }
490 return true;
491}
492
494 switch (m_mode) {
495 case Mode::Always:
496 case Mode::Default:
497 return m_count > 0;
498 case Mode::Never:
499 return false;
500 }
501 return false;
502}
503
505 bool is_failed_description,
506 DumpValueObjectOptions::PointerDepth &curr_ptr_depth) {
507 const bool is_ref = IsRef();
508 const bool is_ptr = IsPtr();
509 const bool is_uninit = IsUninitialized();
510
511 if (is_uninit)
512 return false;
513
514 // if the user has specified an element count, always print children as it is
515 // explicit user demand being honored
516 if (m_options.m_pointer_as_array)
517 return true;
518
519 if (m_options.m_use_objc)
520 return false;
521
522 bool print_children = true;
523 if (TypeSummaryImpl *type_summary = GetSummaryFormatter())
524 print_children = type_summary->DoesPrintChildren(m_valobj);
525
526 if (is_failed_description || !HasReachedMaximumDepth()) {
527 // We will show children for all concrete types. We won't show pointer
528 // contents unless a pointer depth has been specified. We won't reference
529 // contents unless the reference is the root object (depth of zero).
530
531 // Use a new temporary pointer depth in case we override the current
532 // pointer depth below...
533
534 if (is_ptr || is_ref) {
535 // We have a pointer or reference whose value is an address. Make sure
536 // that address is not NULL
537 AddressType ptr_address_type;
538 if (m_valobj->GetPointerValue(&ptr_address_type) == 0)
539 return false;
540
541 const bool is_root_level = m_curr_depth == 0;
542
543 if (is_ref && is_root_level && print_children) {
544 // If this is the root object (depth is zero) that we are showing and
545 // it is a reference, and no pointer depth has been supplied print out
546 // what it references. Don't do this at deeper depths otherwise we can
547 // end up with infinite recursion...
548 return true;
549 }
550
551 return curr_ptr_depth.CanAllowExpansion();
552 }
553
554 return print_children || m_summary.empty();
555 }
556 return false;
557}
558
560 TypeSummaryImpl *entry = GetSummaryFormatter();
561
562 if (!entry)
563 return true;
564
565 return entry->DoesPrintEmptyAggregates();
566}
567
569 return m_valobj;
570}
571
573 bool summary_printed) {
574 if (m_options.m_flat_output) {
575 if (ShouldPrintValueObject())
576 m_stream->EOL();
577 } else {
578 if (ShouldPrintValueObject()) {
579 if (IsRef()) {
580 m_stream->PutCString(": ");
581 } else if (value_printed || summary_printed || ShouldShowName()) {
582 m_stream->PutChar(' ');
583 }
584 m_stream->PutCString("{\n");
585 }
586 m_stream->IndentMore();
587 }
588}
589
591 ValueObjectSP child_sp,
592 const DumpValueObjectOptions::PointerDepth &curr_ptr_depth) {
593 const uint32_t consumed_depth = (!m_options.m_pointer_as_array) ? 1 : 0;
594 const bool does_consume_ptr_depth =
595 ((IsPtr() && !m_options.m_pointer_as_array) || IsRef());
596
597 DumpValueObjectOptions child_options(m_options);
598 child_options.SetFormat(m_options.m_format)
599 .SetSummary()
601 child_options.SetScopeChecked(true)
602 .SetHideName(m_options.m_hide_name)
603 .SetHideValue(m_options.m_hide_value)
605 ? child_options.m_omit_summary_depth -
606 consumed_depth
607 : 0)
608 .SetElementCount(0);
609
610 if (child_sp.get()) {
611 ValueObjectPrinter child_printer(
612 child_sp.get(), m_stream, child_options,
613 does_consume_ptr_depth ? --curr_ptr_depth : curr_ptr_depth,
614 m_curr_depth + consumed_depth, m_printed_instance_pointers);
615 child_printer.PrintValueObject();
616 }
617}
618
620 ValueObject *synth_m_valobj = GetValueObjectForChildrenGeneration();
621
622 if (m_options.m_pointer_as_array)
623 return m_options.m_pointer_as_array.m_element_count;
624
625 size_t num_children = synth_m_valobj->GetNumChildren();
626 print_dotdotdot = false;
627 if (num_children) {
628 const size_t max_num_children =
629 m_valobj->GetTargetSP()->GetMaximumNumberOfChildrenToDisplay();
630
631 if (num_children > max_num_children && !m_options.m_ignore_cap) {
632 print_dotdotdot = true;
633 return max_num_children;
634 }
635 }
636 return num_children;
637}
638
640 if (!m_options.m_flat_output) {
641 if (print_dotdotdot) {
642 m_valobj->GetTargetSP()
643 ->GetDebugger()
644 .GetCommandInterpreter()
645 .ChildrenTruncated();
646 m_stream->Indent("...\n");
647 }
648 m_stream->IndentLess();
649 m_stream->Indent("}\n");
650 }
651}
652
654 bool summary_printed) {
655 ValueObject *synth_m_valobj = GetValueObjectForChildrenGeneration();
656
657 if (!IsAggregate())
658 return false;
659
660 if (!m_options.m_reveal_empty_aggregates) {
661 if (value_printed || summary_printed)
662 return false;
663 }
664
665 if (synth_m_valobj->MightHaveChildren())
666 return true;
667
668 if (m_val_summary_ok)
669 return false;
670
671 return true;
672}
673
674static constexpr size_t PhysicalIndexForLogicalIndex(size_t base, size_t stride,
675 size_t logical) {
676 return base + logical * stride;
677}
678
680 size_t idx) {
681 if (m_options.m_pointer_as_array) {
682 // if generating pointer-as-array children, use GetSyntheticArrayMember
683 return synth_valobj->GetSyntheticArrayMember(
685 m_options.m_pointer_as_array.m_base_element,
686 m_options.m_pointer_as_array.m_stride, idx),
687 true);
688 } else {
689 // otherwise, do the usual thing
690 return synth_valobj->GetChildAtIndex(idx, true);
691 }
692}
693
695 bool value_printed, bool summary_printed,
696 const DumpValueObjectOptions::PointerDepth &curr_ptr_depth) {
697 ValueObject *synth_m_valobj = GetValueObjectForChildrenGeneration();
698
699 bool print_dotdotdot = false;
700 size_t num_children = GetMaxNumChildrenToPrint(print_dotdotdot);
701 if (num_children) {
702 bool any_children_printed = false;
703
704 for (size_t idx = 0; idx < num_children; ++idx) {
705 if (ValueObjectSP child_sp = GenerateChild(synth_m_valobj, idx)) {
706 if (m_options.m_child_printing_decider &&
707 !m_options.m_child_printing_decider(child_sp->GetName()))
708 continue;
709 if (!any_children_printed) {
710 PrintChildrenPreamble(value_printed, summary_printed);
711 any_children_printed = true;
712 }
713 PrintChild(child_sp, curr_ptr_depth);
714 }
715 }
716
717 if (any_children_printed)
718 PrintChildrenPostamble(print_dotdotdot);
719 else {
720 if (ShouldPrintEmptyBrackets(value_printed, summary_printed)) {
721 if (ShouldPrintValueObject())
722 m_stream->PutCString(" {}\n");
723 else
724 m_stream->EOL();
725 } else
726 m_stream->EOL();
727 }
728 } else if (ShouldPrintEmptyBrackets(value_printed, summary_printed)) {
729 // Aggregate, no children...
730 if (ShouldPrintValueObject()) {
731 // if it has a synthetic value, then don't print {}, the synthetic
732 // children are probably only being used to vend a value
733 if (m_valobj->DoesProvideSyntheticValue() ||
734 !ShouldExpandEmptyAggregates())
735 m_stream->PutCString("\n");
736 else
737 m_stream->PutCString(" {}\n");
738 }
739 } else {
740 if (ShouldPrintValueObject())
741 m_stream->EOL();
742 }
743}
744
746 if (!GetMostSpecializedValue() || m_valobj == nullptr)
747 return false;
748
749 ValueObject *synth_m_valobj = GetValueObjectForChildrenGeneration();
750
751 bool print_dotdotdot = false;
752 size_t num_children = GetMaxNumChildrenToPrint(print_dotdotdot);
753
754 if (num_children) {
755 m_stream->PutChar('(');
756
757 bool did_print_children = false;
758 for (uint32_t idx = 0; idx < num_children; ++idx) {
759 lldb::ValueObjectSP child_sp(synth_m_valobj->GetChildAtIndex(idx, true));
760 if (child_sp)
761 child_sp = child_sp->GetQualifiedRepresentationIfAvailable(
762 m_options.m_use_dynamic, m_options.m_use_synthetic);
763 if (child_sp) {
764 if (m_options.m_child_printing_decider &&
765 !m_options.m_child_printing_decider(child_sp->GetName()))
766 continue;
767 if (idx && did_print_children)
768 m_stream->PutCString(", ");
769 did_print_children = true;
770 if (!hide_names) {
771 const char *name = child_sp.get()->GetName().AsCString();
772 if (name && *name) {
773 m_stream->PutCString(name);
774 m_stream->PutCString(" = ");
775 }
776 }
777 child_sp->DumpPrintableRepresentation(
779 m_options.m_format,
781 }
782 }
783
784 if (print_dotdotdot)
785 m_stream->PutCString(", ...)");
786 else
787 m_stream->PutChar(')');
788 }
789 return true;
790}
791
793 bool summary_printed) {
794 // This flag controls whether we tried to display a description for this
795 // object and failed if that happens, we want to display the children if any.
796 bool is_failed_description =
797 !PrintObjectDescriptionIfNeeded(value_printed, summary_printed);
798
799 DumpValueObjectOptions::PointerDepth curr_ptr_depth = m_ptr_depth;
800 const bool print_children =
801 ShouldPrintChildren(is_failed_description, curr_ptr_depth);
802 const bool print_oneline =
803 (curr_ptr_depth.CanAllowExpansion() || m_options.m_show_types ||
804 !m_options.m_allow_oneliner_mode || m_options.m_flat_output ||
805 (m_options.m_pointer_as_array) || m_options.m_show_location)
806 ? false
808 if (print_children && IsInstancePointer()) {
809 uint64_t instance_ptr_value = m_valobj->GetValueAsUnsigned(0);
810 if (m_printed_instance_pointers->count(instance_ptr_value)) {
811 // We already printed this instance-is-pointer thing, so don't expand it.
812 m_stream->PutCString(" {...}\n");
813 return;
814 } else {
815 // Remember this guy for future reference.
816 m_printed_instance_pointers->emplace(instance_ptr_value);
817 }
818 }
819
820 if (print_children) {
821 if (print_oneline) {
822 m_stream->PutChar(' ');
823 PrintChildrenOneLiner(false);
824 m_stream->EOL();
825 } else
826 PrintChildren(value_printed, summary_printed, curr_ptr_depth);
827 } else if (HasReachedMaximumDepth() && IsAggregate() &&
828 ShouldPrintValueObject()) {
829 m_stream->PutCString("{...}\n");
830 // The maximum child depth has been reached. If `m_max_depth` is the default
831 // (i.e. the user has _not_ customized it), then lldb presents a warning to
832 // the user. The warning tells the user that the limit has been reached, but
833 // more importantly tells them how to expand the limit if desired.
834 if (m_options.m_max_depth_is_default)
835 m_valobj->GetTargetSP()
836 ->GetDebugger()
837 .GetCommandInterpreter()
838 .SetReachedMaximumDepth();
839 } else
840 m_stream->EOL();
841}
842
844 return m_curr_depth >= m_options.m_max_depth;
845}
846
848 if (m_curr_depth == 0)
849 return !m_options.m_hide_root_name && !m_options.m_hide_name;
850 return !m_options.m_hide_name;
851}
static llvm::raw_ostream & error(Stream &strm)
static bool IsPointerValue(const CompilerType &type)
static constexpr size_t PhysicalIndexForLogicalIndex(size_t base, size_t stride, size_t logical)
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
A uniqued constant string class.
Definition: ConstString.h:40
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:198
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:221
static bool ShouldPrintAsOneLiner(ValueObject &valobj)
DumpValueObjectOptions & SetHideName(bool hide_name=false)
DumpValueObjectOptions & SetSummary(lldb::TypeSummaryImplSP summary=lldb::TypeSummaryImplSP())
DumpValueObjectOptions & SetOmitSummaryDepth(uint32_t depth=0)
DumpValueObjectOptions & SetRootValueObjectName(const char *name=nullptr)
DumpValueObjectOptions & SetFormat(lldb::Format format=lldb::eFormatDefault)
DumpValueObjectOptions & SetScopeChecked(bool check=true)
DumpValueObjectOptions & SetHideValue(bool hide_value=false)
DumpValueObjectOptions & SetElementCount(uint32_t element_count=0)
A class to manage flags.
Definition: Flags.h:22
bool AllClear(ValueType mask) const
Test if all bits in mask are clear.
Definition: Flags.h:103
bool Test(ValueType bit) const
Test a single flag bit.
Definition: Flags.h:96
bool AnySet(ValueType mask) const
Test one or more flags.
Definition: Flags.h:90
static Language * FindPlugin(lldb::LanguageType language)
Definition: Language.cpp:53
bool Fail() const
Test for error condition.
Definition: Status.cpp:181
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
Definition: Status.cpp:130
const char * GetData() const
Definition: StreamString.h:43
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
Definition: Stream.cpp:130
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
size_t PutChar(char ch)
Definition: Stream.cpp:104
size_t EOL()
Output and End of Line character to the stream.
Definition: Stream.cpp:128
virtual bool DoesPrintEmptyAggregates() const
Definition: TypeSummary.h:214
virtual bool DoesPrintValue(ValueObject *valobj) const
Definition: TypeSummary.h:218
bool PrintObjectDescriptionIfNeeded(bool value_printed, bool summary_printed)
void PrintChildrenPreamble(bool value_printed, bool summary_printed)
std::shared_ptr< InstancePointersSet > InstancePointersSetSP
lldb::ValueObjectSP GenerateChild(ValueObject *synth_valobj, size_t idx)
std::pair< TypeSummaryImpl *, bool > m_summary_formatter
void Init(ValueObject *valobj, Stream *s, const DumpValueObjectOptions &options, const DumpValueObjectOptions::PointerDepth &ptr_depth, uint32_t curr_depth, InstancePointersSetSP printed_instance_pointers)
void PrintChild(lldb::ValueObjectSP child_sp, const DumpValueObjectOptions::PointerDepth &curr_ptr_depth)
TypeSummaryImpl * GetSummaryFormatter(bool null_if_omitted=true)
void PrintChildrenIfNeeded(bool value_printed, bool summary_printed)
DumpValueObjectOptions::PointerDepth m_ptr_depth
uint32_t GetMaxNumChildrenToPrint(bool &print_dotdotdot)
void PrintChildrenPostamble(bool print_dotdotdot)
InstancePointersSetSP m_printed_instance_pointers
void PrintChildren(bool value_printed, bool summary_printed, const DumpValueObjectOptions::PointerDepth &curr_ptr_depth)
bool PrintChildrenOneLiner(bool hide_names)
std::set< uint64_t > InstancePointersSet
ValueObjectPrinter(ValueObject *valobj, Stream *s)
void GetValueSummaryError(std::string &value, std::string &summary, std::string &error)
bool PrintValueAndSummaryIfNeeded(bool &value_printed, bool &summary_printed)
bool ShouldPrintChildren(bool is_failed_description, DumpValueObjectOptions::PointerDepth &curr_ptr_depth)
bool ShouldPrintEmptyBrackets(bool value_printed, bool summary_printed)
lldb::TypeSummaryImplSP GetSummaryFormat()
Definition: ValueObject.h:716
virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx, bool can_create)
virtual bool IsInScope()
Definition: ValueObject.h:420
size_t GetNumChildren(uint32_t max=UINT32_MAX)
virtual bool MightHaveChildren()
Find out if a ValueObject might have children.
CompilerType GetCompilerType()
Definition: ValueObject.h:352
lldb::ValueObjectSP GetSyntheticValue()
lldb::Format GetFormat() const
virtual bool IsDynamic()
Definition: ValueObject.h:636
virtual void GetExpressionPath(Stream &s, GetExpressionPathFormat=eGetExpressionPathFormatDereferencePointers)
virtual lldb::ValueObjectSP GetDynamicValue(lldb::DynamicValueType valueType)
virtual ConstString GetDisplayTypeName()
Definition: ValueObject.h:367
virtual bool IsBaseClass()
Definition: ValueObject.h:398
bool UpdateValueIfNeeded(bool update_format=true)
const Status & GetError()
virtual const char * GetValueAsCString()
virtual const char * GetLocationAsCString()
Definition: ValueObject.h:507
ConstString GetName() const
Definition: ValueObject.h:467
virtual lldb::ValueObjectSP GetStaticValue()
Definition: ValueObject.h:589
virtual ConstString GetQualifiedTypeName()
Definition: ValueObject.h:369
const char * GetObjectDescription()
virtual lldb::ValueObjectSP GetNonSyntheticValue()
Definition: ValueObject.h:591
const char * GetSummaryAsCString(lldb::LanguageType lang=lldb::eLanguageTypeUnknown)
lldb::ValueObjectSP GetSyntheticArrayMember(size_t index, bool can_create)
virtual bool IsSynthetic()
Definition: ValueObject.h:597
const Value & GetValue() const
Definition: ValueObject.h:496
virtual lldb::LanguageType GetPreferredDisplayLanguage()
const CompilerType & GetCompilerType()
Definition: Value.cpp:237
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
Definition: SBAddress.h:15
Format
Display format definitions.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
@ eNoDynamicValues
enum lldb_private::DumpValueObjectOptions::PointerDepth::Mode m_mode