LLDB mainline
LibCxx.cpp
Go to the documentation of this file.
1//===-- LibCxx.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
9#include "LibCxx.h"
10
11#include "lldb/Core/Debugger.h"
20#include "lldb/Target/Target.h"
23#include "lldb/Utility/Endian.h"
24#include "lldb/Utility/Status.h"
25#include "lldb/Utility/Stream.h"
26
30#include <optional>
31#include <tuple>
32
33using namespace lldb;
34using namespace lldb_private;
35using namespace lldb_private::formatters;
36
38 ValueObject &obj, llvm::ArrayRef<ConstString> alternative_names) {
39 for (ConstString name : alternative_names) {
41
42 if (child_sp)
43 return child_sp;
44 }
45 return {};
46}
47
50 ValueObject &pair) {
51 ValueObjectSP value;
52 ValueObjectSP first_child = pair.GetChildAtIndex(0);
53 if (first_child)
54 value = first_child->GetChildMemberWithName("__value_");
55 if (!value) {
56 // pre-r300140 member name
57 value = pair.GetChildMemberWithName("__first_");
58 }
59 return value;
60}
61
64 ValueObject &pair) {
65 ValueObjectSP value;
66 if (pair.GetNumChildrenIgnoringErrors() > 1) {
67 ValueObjectSP second_child = pair.GetChildAtIndex(1);
68 if (second_child) {
69 value = second_child->GetChildMemberWithName("__value_");
70 }
71 }
72 if (!value) {
73 // pre-r300140 member name
74 value = pair.GetChildMemberWithName("__second_");
75 }
76 return value;
77}
78
80 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
81
82 ValueObjectSP valobj_sp(valobj.GetNonSyntheticValue());
83
84 if (!valobj_sp)
85 return false;
86
87 ExecutionContext exe_ctx(valobj_sp->GetExecutionContextRef());
88 Process *process = exe_ctx.GetProcessPtr();
89
90 if (process == nullptr)
91 return false;
92
93 CPPLanguageRuntime *cpp_runtime = CPPLanguageRuntime::Get(*process);
94
95 if (!cpp_runtime)
96 return false;
97
99 cpp_runtime->FindLibCppStdFunctionCallableInfo(valobj_sp);
100
101 switch (callable_info.callable_case) {
102 case CPPLanguageRuntime::LibCppStdFunctionCallableCase::Invalid:
103 stream.Printf(" __f_ = %" PRIu64, callable_info.member_f_pointer_value);
104 return false;
105 break;
106 case CPPLanguageRuntime::LibCppStdFunctionCallableCase::Lambda:
107 stream.Printf(
108 " Lambda in File %s at Line %u",
110 callable_info.callable_line_entry.line);
111 break;
112 case CPPLanguageRuntime::LibCppStdFunctionCallableCase::CallableObject:
113 stream.Printf(
114 " Function in File %s at Line %u",
116 callable_info.callable_line_entry.line);
117 break;
118 case CPPLanguageRuntime::LibCppStdFunctionCallableCase::FreeOrMemberFunction:
119 stream.Printf(" Function = %s ",
120 callable_info.callable_symbol.GetName().GetCString());
121 break;
122 }
123
124 return true;
125}
126
128 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
129 ValueObjectSP valobj_sp(valobj.GetNonSyntheticValue());
130 if (!valobj_sp)
131 return false;
132 ValueObjectSP ptr_sp(valobj_sp->GetChildMemberWithName("__ptr_"));
133 ValueObjectSP count_sp(
134 valobj_sp->GetChildAtNamePath({"__cntrl_", "__shared_owners_"}));
135 ValueObjectSP weakcount_sp(
136 valobj_sp->GetChildAtNamePath({"__cntrl_", "__shared_weak_owners_"}));
137
138 if (!ptr_sp)
139 return false;
140
141 if (ptr_sp->GetValueAsUnsigned(0) == 0) {
142 stream.Printf("nullptr");
143 return true;
144 } else {
145 bool print_pointee = false;
147 ValueObjectSP pointee_sp = ptr_sp->Dereference(error);
148 if (pointee_sp && error.Success()) {
149 if (pointee_sp->DumpPrintableRepresentation(
152 ValueObject::PrintableRepresentationSpecialCases::eDisable,
153 false))
154 print_pointee = true;
155 }
156 if (!print_pointee)
157 stream.Printf("ptr = 0x%" PRIx64, ptr_sp->GetValueAsUnsigned(0));
158 }
159
160 if (count_sp)
161 stream.Printf(" strong=%" PRIu64, 1 + count_sp->GetValueAsUnsigned(0));
162
163 if (weakcount_sp)
164 stream.Printf(" weak=%" PRIu64, 1 + weakcount_sp->GetValueAsUnsigned(0));
165
166 return true;
167}
168
170 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
171 ValueObjectSP valobj_sp(valobj.GetNonSyntheticValue());
172 if (!valobj_sp)
173 return false;
174
175 ValueObjectSP ptr_sp(valobj_sp->GetChildMemberWithName("__ptr_"));
176 if (!ptr_sp)
177 return false;
178
179 ptr_sp = GetFirstValueOfLibCXXCompressedPair(*ptr_sp);
180 if (!ptr_sp)
181 return false;
182
183 if (ptr_sp->GetValueAsUnsigned(0) == 0) {
184 stream.Printf("nullptr");
185 return true;
186 } else {
187 bool print_pointee = false;
189 ValueObjectSP pointee_sp = ptr_sp->Dereference(error);
190 if (pointee_sp && error.Success()) {
191 if (pointee_sp->DumpPrintableRepresentation(
194 ValueObject::PrintableRepresentationSpecialCases::eDisable,
195 false))
196 print_pointee = true;
197 }
198 if (!print_pointee)
199 stream.Printf("ptr = 0x%" PRIx64, ptr_sp->GetValueAsUnsigned(0));
200 }
201
202 return true;
203}
204
205/*
206 (lldb) fr var ibeg --raw --ptr-depth 1
207 (std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::pair<int,
208 std::__1::basic_string<char, std::__1::char_traits<char>,
209 std::__1::allocator<char> > >, std::__1::__tree_node<std::__1::pair<int,
210 std::__1::basic_string<char, std::__1::char_traits<char>,
211 std::__1::allocator<char> > >, void *> *, long> >) ibeg = {
212 __i_ = {
213 __ptr_ = 0x0000000100103870 {
214 std::__1::__tree_node_base<void *> = {
215 std::__1::__tree_end_node<std::__1::__tree_node_base<void *> *> = {
216 __left_ = 0x0000000000000000
217 }
218 __right_ = 0x0000000000000000
219 __parent_ = 0x00000001001038b0
220 __is_black_ = true
221 }
222 __value_ = {
223 first = 0
224 second = { std::string }
225 */
226
229 : SyntheticChildrenFrontEnd(*valobj_sp), m_pair_ptr(), m_pair_sp() {
230 if (valobj_sp)
231 Update();
232}
233
236 m_pair_sp.reset();
237 m_pair_ptr = nullptr;
238
239 ValueObjectSP valobj_sp = m_backend.GetSP();
240 if (!valobj_sp)
242
243 TargetSP target_sp(valobj_sp->GetTargetSP());
244
245 if (!target_sp)
247
248 if (!valobj_sp)
250
251 // this must be a ValueObject* because it is a child of the ValueObject we
252 // are producing children for it if were a ValueObjectSP, we would end up
253 // with a loop (iterator -> synthetic -> child -> parent == iterator) and
254 // that would in turn leak memory by never allowing the ValueObjects to die
255 // and free their memory
256 m_pair_ptr = valobj_sp
257 ->GetValueForExpressionPath(
258 ".__i_.__ptr_->__value_", nullptr, nullptr,
260 .DontCheckDotVsArrowSyntax()
261 .SetSyntheticChildrenTraversal(
263 SyntheticChildrenTraversal::None),
264 nullptr)
265 .get();
266
267 if (!m_pair_ptr) {
268 m_pair_ptr = valobj_sp
269 ->GetValueForExpressionPath(
270 ".__i_.__ptr_", nullptr, nullptr,
272 .DontCheckDotVsArrowSyntax()
273 .SetSyntheticChildrenTraversal(
275 SyntheticChildrenTraversal::None),
276 nullptr)
277 .get();
278 if (m_pair_ptr) {
279 auto __i_(valobj_sp->GetChildMemberWithName("__i_"));
280 if (!__i_) {
281 m_pair_ptr = nullptr;
283 }
284 CompilerType pair_type(
285 __i_->GetCompilerType().GetTypeTemplateArgument(0));
286 std::string name;
287 uint64_t bit_offset_ptr;
288 uint32_t bitfield_bit_size_ptr;
289 bool is_bitfield_ptr;
290 pair_type = pair_type.GetFieldAtIndex(
291 0, name, &bit_offset_ptr, &bitfield_bit_size_ptr, &is_bitfield_ptr);
292 if (!pair_type) {
293 m_pair_ptr = nullptr;
295 }
296
297 auto addr(m_pair_ptr->GetValueAsUnsigned(LLDB_INVALID_ADDRESS));
298 m_pair_ptr = nullptr;
299 if (addr && addr != LLDB_INVALID_ADDRESS) {
300 auto ts = pair_type.GetTypeSystem();
301 auto ast_ctx = ts.dyn_cast_or_null<TypeSystemClang>();
302 if (!ast_ctx)
304
305 // Mimick layout of std::__tree_iterator::__ptr_ and read it in
306 // from process memory.
307 //
308 // The following shows the contiguous block of memory:
309 //
310 // +-----------------------------+ class __tree_end_node
311 // __ptr_ | pointer __left_; |
312 // +-----------------------------+ class __tree_node_base
313 // | pointer __right_; |
314 // | __parent_pointer __parent_; |
315 // | bool __is_black_; |
316 // +-----------------------------+ class __tree_node
317 // | __node_value_type __value_; | <<< our key/value pair
318 // +-----------------------------+
319 //
320 CompilerType tree_node_type = ast_ctx->CreateStructForIdentifier(
321 llvm::StringRef(),
322 {{"ptr0",
323 ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
324 {"ptr1",
325 ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
326 {"ptr2",
327 ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
328 {"cw", ast_ctx->GetBasicType(lldb::eBasicTypeBool)},
329 {"payload", pair_type}});
330 std::optional<uint64_t> size = tree_node_type.GetByteSize(nullptr);
331 if (!size)
333 WritableDataBufferSP buffer_sp(new DataBufferHeap(*size, 0));
334 ProcessSP process_sp(target_sp->GetProcessSP());
336 process_sp->ReadMemory(addr, buffer_sp->GetBytes(),
337 buffer_sp->GetByteSize(), error);
338 if (error.Fail())
340 DataExtractor extractor(buffer_sp, process_sp->GetByteOrder(),
341 process_sp->GetAddressByteSize());
342 auto pair_sp = CreateValueObjectFromData(
343 "pair", extractor, valobj_sp->GetExecutionContextRef(),
344 tree_node_type);
345 if (pair_sp)
346 m_pair_sp = pair_sp->GetChildAtIndex(4);
347 }
348 }
349 }
350
352}
353
354llvm::Expected<uint32_t> lldb_private::formatters::
356 return 2;
357}
358
361 uint32_t idx) {
362 if (m_pair_ptr)
363 return m_pair_ptr->GetChildAtIndex(idx);
364 if (m_pair_sp)
365 return m_pair_sp->GetChildAtIndex(idx);
366 return lldb::ValueObjectSP();
367}
368
371 return true;
372}
373
376 if (name == "first")
377 return 0;
378 if (name == "second")
379 return 1;
380 return UINT32_MAX;
381}
382
385 // this will be deleted when its parent dies (since it's a child object)
386 // delete m_pair_ptr;
387}
388
392 return (valobj_sp ? new LibCxxMapIteratorSyntheticFrontEnd(valobj_sp)
393 : nullptr);
394}
395
398 : SyntheticChildrenFrontEnd(*valobj_sp) {
399 if (valobj_sp)
400 Update();
401}
402
405 m_pair_sp.reset();
406 m_iter_ptr = nullptr;
407
408 ValueObjectSP valobj_sp = m_backend.GetSP();
409 if (!valobj_sp)
411
412 TargetSP target_sp(valobj_sp->GetTargetSP());
413
414 if (!target_sp)
416
417 if (!valobj_sp)
419
420 auto exprPathOptions = ValueObject::GetValueForExpressionPathOptions()
424 SyntheticChildrenTraversal::None);
425
426 // This must be a ValueObject* because it is a child of the ValueObject we
427 // are producing children for it if were a ValueObjectSP, we would end up
428 // with a loop (iterator -> synthetic -> child -> parent == iterator) and
429 // that would in turn leak memory by never allowing the ValueObjects to die
430 // and free their memory.
431 m_iter_ptr =
432 valobj_sp
433 ->GetValueForExpressionPath(".__i_.__node_", nullptr, nullptr,
434 exprPathOptions, nullptr)
435 .get();
436
437 if (m_iter_ptr) {
438 auto iter_child(valobj_sp->GetChildMemberWithName("__i_"));
439 if (!iter_child) {
440 m_iter_ptr = nullptr;
442 }
443
444 CompilerType node_type(iter_child->GetCompilerType()
445 .GetTypeTemplateArgument(0)
446 .GetPointeeType());
447
448 CompilerType pair_type(node_type.GetTypeTemplateArgument(0));
449
450 std::string name;
451 uint64_t bit_offset_ptr;
452 uint32_t bitfield_bit_size_ptr;
453 bool is_bitfield_ptr;
454
455 pair_type = pair_type.GetFieldAtIndex(
456 0, name, &bit_offset_ptr, &bitfield_bit_size_ptr, &is_bitfield_ptr);
457 if (!pair_type) {
458 m_iter_ptr = nullptr;
460 }
461
462 uint64_t addr = m_iter_ptr->GetValueAsUnsigned(LLDB_INVALID_ADDRESS);
463 m_iter_ptr = nullptr;
464
465 if (addr == 0 || addr == LLDB_INVALID_ADDRESS)
467
468 auto ts = pair_type.GetTypeSystem();
469 auto ast_ctx = ts.dyn_cast_or_null<TypeSystemClang>();
470 if (!ast_ctx)
472
473 // Mimick layout of std::__hash_iterator::__node_ and read it in
474 // from process memory.
475 //
476 // The following shows the contiguous block of memory:
477 //
478 // +-----------------------------+ class __hash_node_base
479 // __node_ | __next_pointer __next_; |
480 // +-----------------------------+ class __hash_node
481 // | size_t __hash_; |
482 // | __node_value_type __value_; | <<< our key/value pair
483 // +-----------------------------+
484 //
485 CompilerType tree_node_type = ast_ctx->CreateStructForIdentifier(
486 llvm::StringRef(),
487 {{"__next_",
488 ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
489 {"__hash_", ast_ctx->GetBasicType(lldb::eBasicTypeUnsignedLongLong)},
490 {"__value_", pair_type}});
491 std::optional<uint64_t> size = tree_node_type.GetByteSize(nullptr);
492 if (!size)
494 WritableDataBufferSP buffer_sp(new DataBufferHeap(*size, 0));
495 ProcessSP process_sp(target_sp->GetProcessSP());
497 process_sp->ReadMemory(addr, buffer_sp->GetBytes(),
498 buffer_sp->GetByteSize(), error);
499 if (error.Fail())
501 DataExtractor extractor(buffer_sp, process_sp->GetByteOrder(),
502 process_sp->GetAddressByteSize());
503 auto pair_sp = CreateValueObjectFromData(
504 "pair", extractor, valobj_sp->GetExecutionContextRef(), tree_node_type);
505 if (pair_sp)
506 m_pair_sp = pair_sp->GetChildAtIndex(2);
507 }
508
510}
511
512llvm::Expected<uint32_t> lldb_private::formatters::
514 return 2;
515}
516
519 if (m_pair_sp)
520 return m_pair_sp->GetChildAtIndex(idx);
521 return lldb::ValueObjectSP();
522}
523
526 return true;
527}
528
531 if (name == "first")
532 return 0;
533 if (name == "second")
534 return 1;
535 return UINT32_MAX;
536}
537
541 return (valobj_sp ? new LibCxxUnorderedMapIteratorSyntheticFrontEnd(valobj_sp)
542 : nullptr);
543}
544
545/*
546 (lldb) fr var ibeg --raw --ptr-depth 1 -T
547 (std::__1::__wrap_iter<int *>) ibeg = {
548 (std::__1::__wrap_iter<int *>::iterator_type) __i = 0x00000001001037a0 {
549 (int) *__i = 1
550 }
551 }
552*/
553
557 return (valobj_sp ? new VectorIteratorSyntheticFrontEnd(
558 valobj_sp, {ConstString("__i_"), ConstString("__i")})
559 : nullptr);
560}
561
564 : SyntheticChildrenFrontEnd(*valobj_sp), m_cntrl(nullptr) {
565 if (valobj_sp)
566 Update();
567}
568
569llvm::Expected<uint32_t> lldb_private::formatters::
571 return (m_cntrl ? 1 : 0);
572}
573
576 uint32_t idx) {
577 if (!m_cntrl)
578 return lldb::ValueObjectSP();
579
580 ValueObjectSP valobj_sp = m_backend.GetSP();
581 if (!valobj_sp)
582 return lldb::ValueObjectSP();
583
584 if (idx == 0)
585 return valobj_sp->GetChildMemberWithName("__ptr_");
586
587 if (idx == 1) {
588 if (auto ptr_sp = valobj_sp->GetChildMemberWithName("__ptr_")) {
589 Status status;
590 auto value_type_sp =
591 valobj_sp->GetCompilerType()
592 .GetTypeTemplateArgument(0).GetPointerType();
593 ValueObjectSP cast_ptr_sp = ptr_sp->Cast(value_type_sp);
594 ValueObjectSP value_sp = cast_ptr_sp->Dereference(status);
595 if (status.Success()) {
596 return value_sp;
597 }
598 }
599 }
600
601 return lldb::ValueObjectSP();
602}
603
606 m_cntrl = nullptr;
607
608 ValueObjectSP valobj_sp = m_backend.GetSP();
609 if (!valobj_sp)
611
612 TargetSP target_sp(valobj_sp->GetTargetSP());
613 if (!target_sp)
615
616 lldb::ValueObjectSP cntrl_sp(valobj_sp->GetChildMemberWithName("__cntrl_"));
617
618 m_cntrl = cntrl_sp.get(); // need to store the raw pointer to avoid a circular
619 // dependency
621}
622
625 return true;
626}
627
630 if (name == "__ptr_")
631 return 0;
632 if (name == "$$dereference$$")
633 return 1;
634 return UINT32_MAX;
635}
636
639
643 return (valobj_sp ? new LibcxxSharedPtrSyntheticFrontEnd(valobj_sp)
644 : nullptr);
645}
646
649 : SyntheticChildrenFrontEnd(*valobj_sp) {
650 if (valobj_sp)
651 Update();
652}
653
656
660 return (valobj_sp ? new LibcxxUniquePtrSyntheticFrontEnd(valobj_sp)
661 : nullptr);
662}
663
664llvm::Expected<uint32_t> lldb_private::formatters::
666 if (m_value_ptr_sp)
667 return m_deleter_sp ? 2 : 1;
668 return 0;
669}
670
673 uint32_t idx) {
674 if (!m_value_ptr_sp)
675 return lldb::ValueObjectSP();
676
677 if (idx == 0)
678 return m_value_ptr_sp;
679
680 if (idx == 1)
681 return m_deleter_sp;
682
683 if (idx == 2) {
684 Status status;
685 auto value_sp = m_value_ptr_sp->Dereference(status);
686 if (status.Success()) {
687 return value_sp;
688 }
689 }
690
691 return lldb::ValueObjectSP();
692}
693
696 ValueObjectSP valobj_sp = m_backend.GetSP();
697 if (!valobj_sp)
699
700 ValueObjectSP ptr_sp(valobj_sp->GetChildMemberWithName("__ptr_"));
701 if (!ptr_sp)
703
704 // Retrieve the actual pointer and the deleter, and clone them to give them
705 // user-friendly names.
706 ValueObjectSP value_pointer_sp = GetFirstValueOfLibCXXCompressedPair(*ptr_sp);
707 if (value_pointer_sp)
708 m_value_ptr_sp = value_pointer_sp->Clone(ConstString("pointer"));
709
711 if (deleter_sp)
712 m_deleter_sp = deleter_sp->Clone(ConstString("deleter"));
713
715}
716
719 return true;
720}
721
724 if (name == "pointer")
725 return 0;
726 if (name == "deleter")
727 return 1;
728 if (name == "$$dereference$$")
729 return 2;
730 return UINT32_MAX;
731}
732
734 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
735 if (valobj.IsPointerType()) {
736 uint64_t value = valobj.GetValueAsUnsigned(0);
737 if (!value)
738 return false;
739 stream.Printf("0x%016" PRIx64 " ", value);
740 }
741 return FormatEntity::FormatStringRef("size=${svar%#}", stream, nullptr,
742 nullptr, nullptr, &valobj, false, false);
743}
744
745/// The field layout in a libc++ string (cap, side, data or data, size, cap).
746namespace {
747enum class StringLayout { CSD, DSC };
748}
749
750/// Determine the size in bytes of \p valobj (a libc++ std::string object) and
751/// extract its data payload. Return the size + payload pair.
752// TODO: Support big-endian architectures.
753static std::optional<std::pair<uint64_t, ValueObjectSP>>
755 ValueObjectSP valobj_r_sp = valobj.GetChildMemberWithName("__r_");
756 if (!valobj_r_sp || !valobj_r_sp->GetError().Success())
757 return {};
758
759 // __r_ is a compressed_pair of the actual data and the allocator. The data we
760 // want is in the first base class.
761 ValueObjectSP valobj_r_base_sp = valobj_r_sp->GetChildAtIndex(0);
762 if (!valobj_r_base_sp)
763 return {};
764
765 ValueObjectSP valobj_rep_sp =
766 valobj_r_base_sp->GetChildMemberWithName("__value_");
767 if (!valobj_rep_sp)
768 return {};
769
770 ValueObjectSP l = valobj_rep_sp->GetChildMemberWithName("__l");
771 if (!l)
772 return {};
773
774 StringLayout layout = l->GetIndexOfChildWithName("__data_") == 0
775 ? StringLayout::DSC
776 : StringLayout::CSD;
777
778 bool short_mode = false; // this means the string is in short-mode and the
779 // data is stored inline
780 bool using_bitmasks = true; // Whether the class uses bitmasks for the mode
781 // flag (pre-D123580).
782 uint64_t size;
783 uint64_t size_mode_value = 0;
784
785 ValueObjectSP short_sp = valobj_rep_sp->GetChildMemberWithName("__s");
786 if (!short_sp)
787 return {};
788
789 ValueObjectSP is_long = short_sp->GetChildMemberWithName("__is_long_");
790 ValueObjectSP size_sp = short_sp->GetChildMemberWithName("__size_");
791 if (!size_sp)
792 return {};
793
794 if (is_long) {
795 using_bitmasks = false;
796 short_mode = !is_long->GetValueAsUnsigned(/*fail_value=*/0);
797 size = size_sp->GetValueAsUnsigned(/*fail_value=*/0);
798 } else {
799 // The string mode is encoded in the size field.
800 size_mode_value = size_sp->GetValueAsUnsigned(0);
801 uint8_t mode_mask = layout == StringLayout::DSC ? 0x80 : 1;
802 short_mode = (size_mode_value & mode_mask) == 0;
803 }
804
805 if (short_mode) {
806 ValueObjectSP location_sp = short_sp->GetChildMemberWithName("__data_");
807 if (using_bitmasks)
808 size = (layout == StringLayout::DSC) ? size_mode_value
809 : ((size_mode_value >> 1) % 256);
810
811 // When the small-string optimization takes place, the data must fit in the
812 // inline string buffer (23 bytes on x86_64/Darwin). If it doesn't, it's
813 // likely that the string isn't initialized and we're reading garbage.
814 ExecutionContext exe_ctx(location_sp->GetExecutionContextRef());
815 const std::optional<uint64_t> max_bytes =
816 location_sp->GetCompilerType().GetByteSize(
818 if (!max_bytes || size > *max_bytes || !location_sp)
819 return {};
820
821 return std::make_pair(size, location_sp);
822 }
823
824 // we can use the layout_decider object as the data pointer
825 ValueObjectSP location_sp = l->GetChildMemberWithName("__data_");
826 ValueObjectSP size_vo = l->GetChildMemberWithName("__size_");
827 ValueObjectSP capacity_vo = l->GetChildMemberWithName("__cap_");
828 if (!size_vo || !location_sp || !capacity_vo)
829 return {};
830 size = size_vo->GetValueAsUnsigned(LLDB_INVALID_OFFSET);
831 uint64_t capacity = capacity_vo->GetValueAsUnsigned(LLDB_INVALID_OFFSET);
832 if (!using_bitmasks && layout == StringLayout::CSD)
833 capacity *= 2;
834 if (size == LLDB_INVALID_OFFSET || capacity == LLDB_INVALID_OFFSET ||
835 capacity < size)
836 return {};
837 return std::make_pair(size, location_sp);
838}
839
840static bool
842 const TypeSummaryOptions &summary_options,
843 ValueObjectSP location_sp, size_t size) {
844 if (size == 0) {
845 stream.Printf("L\"\"");
846 return true;
847 }
848 if (!location_sp)
849 return false;
850
852 if (summary_options.GetCapping() == TypeSummaryCapping::eTypeSummaryCapped) {
853 const auto max_size = valobj.GetTargetSP()->GetMaximumSizeOfStringSummary();
854 if (size > max_size) {
855 size = max_size;
856 options.SetIsTruncated(true);
857 }
858 }
859
860 DataExtractor extractor;
861 const size_t bytes_read = location_sp->GetPointeeData(extractor, 0, size);
862 if (bytes_read < size)
863 return false;
864
865 // std::wstring::size() is measured in 'characters', not bytes
866 TypeSystemClangSP scratch_ts_sp =
868 if (!scratch_ts_sp)
869 return false;
870
871 auto wchar_t_size =
872 scratch_ts_sp->GetBasicType(lldb::eBasicTypeWChar).GetByteSize(nullptr);
873 if (!wchar_t_size)
874 return false;
875
876 options.SetData(std::move(extractor));
877 options.SetStream(&stream);
878 options.SetPrefixToken("L");
879 options.SetQuote('"');
880 options.SetSourceSize(size);
881 options.SetBinaryZeroIsTerminator(false);
882
883 switch (*wchar_t_size) {
884 case 1:
886 lldb_private::formatters::StringPrinter::StringElementType::UTF8>(
887 options);
888 break;
889
890 case 2:
892 lldb_private::formatters::StringPrinter::StringElementType::UTF16>(
893 options);
894 break;
895
896 case 4:
898 lldb_private::formatters::StringPrinter::StringElementType::UTF32>(
899 options);
900 }
901 return false;
902}
903
905 ValueObject &valobj, Stream &stream,
906 const TypeSummaryOptions &summary_options) {
907 auto string_info = ExtractLibcxxStringInfo(valobj);
908 if (!string_info)
909 return false;
910 uint64_t size;
911 ValueObjectSP location_sp;
912 std::tie(size, location_sp) = *string_info;
913
914 return ::LibcxxWStringSummaryProvider(valobj, stream, summary_options,
915 location_sp, size);
916}
917
918template <StringPrinter::StringElementType element_type>
919static bool
921 const TypeSummaryOptions &summary_options,
922 std::string prefix_token, ValueObjectSP location_sp,
923 uint64_t size) {
924
925 if (size == 0) {
926 stream.Printf("\"\"");
927 return true;
928 }
929
930 if (!location_sp)
931 return false;
932
934
935 if (summary_options.GetCapping() == TypeSummaryCapping::eTypeSummaryCapped) {
936 const auto max_size = valobj.GetTargetSP()->GetMaximumSizeOfStringSummary();
937 if (size > max_size) {
938 size = max_size;
939 options.SetIsTruncated(true);
940 }
941 }
942
943 {
944 DataExtractor extractor;
945 const size_t bytes_read = location_sp->GetPointeeData(extractor, 0, size);
946 if (bytes_read < size)
947 return false;
948
949 options.SetData(std::move(extractor));
950 }
951 options.SetStream(&stream);
952 if (prefix_token.empty())
953 options.SetPrefixToken(nullptr);
954 else
955 options.SetPrefixToken(prefix_token);
956 options.SetQuote('"');
957 options.SetSourceSize(size);
958 options.SetBinaryZeroIsTerminator(false);
959 return StringPrinter::ReadBufferAndDumpToStream<element_type>(options);
960}
961
962template <StringPrinter::StringElementType element_type>
963static bool
965 const TypeSummaryOptions &summary_options,
966 std::string prefix_token) {
967 auto string_info = ExtractLibcxxStringInfo(valobj);
968 if (!string_info)
969 return false;
970 uint64_t size;
971 ValueObjectSP location_sp;
972 std::tie(size, location_sp) = *string_info;
973
974 return LibcxxStringSummaryProvider<element_type>(
975 valobj, stream, summary_options, prefix_token, location_sp, size);
976}
977template <StringPrinter::StringElementType element_type>
978static bool formatStringImpl(ValueObject &valobj, Stream &stream,
979 const TypeSummaryOptions &summary_options,
980 std::string prefix_token) {
981 StreamString scratch_stream;
982 const bool success = LibcxxStringSummaryProvider<element_type>(
983 valobj, scratch_stream, summary_options, prefix_token);
984 if (success)
985 stream << scratch_stream.GetData();
986 else
987 stream << "Summary Unavailable";
988 return true;
989}
990
992 ValueObject &valobj, Stream &stream,
993 const TypeSummaryOptions &summary_options) {
994 return formatStringImpl<StringPrinter::StringElementType::ASCII>(
995 valobj, stream, summary_options, "");
996}
997
999 ValueObject &valobj, Stream &stream,
1000 const TypeSummaryOptions &summary_options) {
1001 return formatStringImpl<StringPrinter::StringElementType::UTF16>(
1002 valobj, stream, summary_options, "u");
1003}
1004
1006 ValueObject &valobj, Stream &stream,
1007 const TypeSummaryOptions &summary_options) {
1008 return formatStringImpl<StringPrinter::StringElementType::UTF32>(
1009 valobj, stream, summary_options, "U");
1010}
1011
1012static std::tuple<bool, ValueObjectSP, size_t>
1014 auto dataobj = GetChildMemberWithName(
1015 valobj, {ConstString("__data_"), ConstString("__data")});
1016 auto sizeobj = GetChildMemberWithName(
1017 valobj, {ConstString("__size_"), ConstString("__size")});
1018 if (!dataobj || !sizeobj)
1019 return std::make_tuple<bool,ValueObjectSP,size_t>(false, {}, {});
1020
1021 if (!dataobj->GetError().Success() || !sizeobj->GetError().Success())
1022 return std::make_tuple<bool,ValueObjectSP,size_t>(false, {}, {});
1023
1024 bool success{false};
1025 uint64_t size = sizeobj->GetValueAsUnsigned(0, &success);
1026 if (!success)
1027 return std::make_tuple<bool,ValueObjectSP,size_t>(false, {}, {});
1028
1029 return std::make_tuple(true,dataobj,size);
1030}
1031
1032template <StringPrinter::StringElementType element_type>
1033static bool formatStringViewImpl(ValueObject &valobj, Stream &stream,
1034 const TypeSummaryOptions &summary_options,
1035 std::string prefix_token) {
1036
1037 bool success;
1038 ValueObjectSP dataobj;
1039 size_t size;
1040 std::tie(success, dataobj, size) = LibcxxExtractStringViewData(valobj);
1041
1042 if (!success) {
1043 stream << "Summary Unavailable";
1044 return true;
1045 }
1046
1047 return LibcxxStringSummaryProvider<element_type>(
1048 valobj, stream, summary_options, prefix_token, dataobj, size);
1049}
1050
1052 ValueObject &valobj, Stream &stream,
1053 const TypeSummaryOptions &summary_options) {
1054 return formatStringViewImpl<StringPrinter::StringElementType::ASCII>(
1055 valobj, stream, summary_options, "");
1056}
1057
1059 ValueObject &valobj, Stream &stream,
1060 const TypeSummaryOptions &summary_options) {
1061 return formatStringViewImpl<StringPrinter::StringElementType::UTF16>(
1062 valobj, stream, summary_options, "u");
1063}
1064
1066 ValueObject &valobj, Stream &stream,
1067 const TypeSummaryOptions &summary_options) {
1068 return formatStringViewImpl<StringPrinter::StringElementType::UTF32>(
1069 valobj, stream, summary_options, "U");
1070}
1071
1073 ValueObject &valobj, Stream &stream,
1074 const TypeSummaryOptions &summary_options) {
1075
1076 bool success;
1077 ValueObjectSP dataobj;
1078 size_t size;
1079 std::tie(success, dataobj, size) = LibcxxExtractStringViewData(valobj);
1080
1081 if (!success) {
1082 stream << "Summary Unavailable";
1083 return true;
1084 }
1085
1086 return ::LibcxxWStringSummaryProvider(valobj, stream, summary_options,
1087 dataobj, size);
1088}
1089
1090static bool
1092 const TypeSummaryOptions &options,
1093 const char *fmt) {
1094 ValueObjectSP ptr_sp = valobj.GetChildMemberWithName("__d_");
1095 if (!ptr_sp)
1096 return false;
1097 ptr_sp = ptr_sp->GetChildMemberWithName("__rep_");
1098 if (!ptr_sp)
1099 return false;
1100
1101 // The date time in the chrono library is valid in the range
1102 // [-32767-01-01T00:00:00Z, 32767-12-31T23:59:59Z]. A 64-bit time_t has a
1103 // larger range, the function strftime is not able to format the entire range
1104 // of time_t. The exact point has not been investigated; it's limited to
1105 // chrono's range.
1106 const std::time_t chrono_timestamp_min =
1107 -1'096'193'779'200; // -32767-01-01T00:00:00Z
1108 const std::time_t chrono_timestamp_max =
1109 971'890'963'199; // 32767-12-31T23:59:59Z
1110
1111 const std::time_t seconds = ptr_sp->GetValueAsSigned(0);
1112 if (seconds < chrono_timestamp_min || seconds > chrono_timestamp_max)
1113 stream.Printf("timestamp=%" PRId64 " s", static_cast<int64_t>(seconds));
1114 else {
1115 std::array<char, 128> str;
1116 std::size_t size =
1117 std::strftime(str.data(), str.size(), fmt, gmtime(&seconds));
1118 if (size == 0)
1119 return false;
1120
1121 stream.Printf("date/time=%s timestamp=%" PRId64 " s", str.data(),
1122 static_cast<int64_t>(seconds));
1123 }
1124
1125 return true;
1126}
1127
1129 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
1130 return LibcxxChronoTimePointSecondsSummaryProvider(valobj, stream, options,
1131 "%FT%H:%M:%SZ");
1132}
1133
1135 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
1136 return LibcxxChronoTimePointSecondsSummaryProvider(valobj, stream, options,
1137 "%FT%H:%M:%S");
1138}
1139
1140static bool
1142 const TypeSummaryOptions &options,
1143 const char *fmt) {
1144 ValueObjectSP ptr_sp = valobj.GetChildMemberWithName("__d_");
1145 if (!ptr_sp)
1146 return false;
1147 ptr_sp = ptr_sp->GetChildMemberWithName("__rep_");
1148 if (!ptr_sp)
1149 return false;
1150
1151 // The date time in the chrono library is valid in the range
1152 // [-32767-01-01Z, 32767-12-31Z]. A 32-bit time_t has a larger range, the
1153 // function strftime is not able to format the entire range of time_t. The
1154 // exact point has not been investigated; it's limited to chrono's range.
1155 const int chrono_timestamp_min = -12'687'428; // -32767-01-01Z
1156 const int chrono_timestamp_max = 11'248'737; // 32767-12-31Z
1157
1158 const int days = ptr_sp->GetValueAsSigned(0);
1159 if (days < chrono_timestamp_min || days > chrono_timestamp_max)
1160 stream.Printf("timestamp=%d days", days);
1161
1162 else {
1163 const std::time_t seconds = std::time_t(86400) * days;
1164
1165 std::array<char, 128> str;
1166 std::size_t size =
1167 std::strftime(str.data(), str.size(), fmt, gmtime(&seconds));
1168 if (size == 0)
1169 return false;
1170
1171 stream.Printf("date=%s timestamp=%d days", str.data(), days);
1172 }
1173
1174 return true;
1175}
1176
1178 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
1179 return LibcxxChronoTimepointDaysSummaryProvider(valobj, stream, options,
1180 "%FZ");
1181}
1182
1184 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
1185 return LibcxxChronoTimepointDaysSummaryProvider(valobj, stream, options,
1186 "%F");
1187}
1188
1190 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
1191 // FIXME: These are the names used in the C++20 ostream operator. Since LLVM
1192 // uses C++17 it's not possible to use the ostream operator directly.
1193 static const std::array<std::string_view, 12> months = {
1194 "January", "February", "March", "April", "May", "June",
1195 "July", "August", "September", "October", "November", "December"};
1196
1197 ValueObjectSP ptr_sp = valobj.GetChildMemberWithName("__m_");
1198 if (!ptr_sp)
1199 return false;
1200
1201 const unsigned month = ptr_sp->GetValueAsUnsigned(0);
1202 if (month >= 1 && month <= 12)
1203 stream << "month=" << months[month - 1];
1204 else
1205 stream.Printf("month=%u", month);
1206
1207 return true;
1208}
1209
1211 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
1212 // FIXME: These are the names used in the C++20 ostream operator. Since LLVM
1213 // uses C++17 it's not possible to use the ostream operator directly.
1214 static const std::array<std::string_view, 7> weekdays = {
1215 "Sunday", "Monday", "Tuesday", "Wednesday",
1216 "Thursday", "Friday", "Saturday"};
1217
1218 ValueObjectSP ptr_sp = valobj.GetChildMemberWithName("__wd_");
1219 if (!ptr_sp)
1220 return false;
1221
1222 const unsigned weekday = ptr_sp->GetValueAsUnsigned(0);
1223 if (weekday < 7)
1224 stream << "weekday=" << weekdays[weekday];
1225 else
1226 stream.Printf("weekday=%u", weekday);
1227
1228 return true;
1229}
1230
1232 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
1233 ValueObjectSP ptr_sp = valobj.GetChildMemberWithName("__y_");
1234 if (!ptr_sp)
1235 return false;
1236 ptr_sp = ptr_sp->GetChildMemberWithName("__y_");
1237 if (!ptr_sp)
1238 return false;
1239 int year = ptr_sp->GetValueAsSigned(0);
1240
1241 ptr_sp = valobj.GetChildMemberWithName("__m_");
1242 if (!ptr_sp)
1243 return false;
1244 ptr_sp = ptr_sp->GetChildMemberWithName("__m_");
1245 if (!ptr_sp)
1246 return false;
1247 const unsigned month = ptr_sp->GetValueAsUnsigned(0);
1248
1249 ptr_sp = valobj.GetChildMemberWithName("__d_");
1250 if (!ptr_sp)
1251 return false;
1252 ptr_sp = ptr_sp->GetChildMemberWithName("__d_");
1253 if (!ptr_sp)
1254 return false;
1255 const unsigned day = ptr_sp->GetValueAsUnsigned(0);
1256
1257 stream << "date=";
1258 if (year < 0) {
1259 stream << '-';
1260 year = -year;
1261 }
1262 stream.Printf("%04d-%02u-%02u", year, month, day);
1263
1264 return true;
1265}
static llvm::raw_ostream & error(Stream &strm)
static bool LibcxxChronoTimepointDaysSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options, const char *fmt)
Definition: LibCxx.cpp:1141
static bool formatStringImpl(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options, std::string prefix_token)
Definition: LibCxx.cpp:978
static std::optional< std::pair< uint64_t, ValueObjectSP > > ExtractLibcxxStringInfo(ValueObject &valobj)
Determine the size in bytes of valobj (a libc++ std::string object) and extract its data payload.
Definition: LibCxx.cpp:754
static bool formatStringViewImpl(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options, std::string prefix_token)
Definition: LibCxx.cpp:1033
static bool LibcxxStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options, std::string prefix_token, ValueObjectSP location_sp, uint64_t size)
Definition: LibCxx.cpp:920
static std::tuple< bool, ValueObjectSP, size_t > LibcxxExtractStringViewData(ValueObject &valobj)
Definition: LibCxx.cpp:1013
static bool LibcxxChronoTimePointSecondsSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options, const char *fmt)
Definition: LibCxx.cpp:1091
LibCppStdFunctionCallableInfo FindLibCppStdFunctionCallableInfo(lldb::ValueObjectSP &valobj_sp)
static CPPLanguageRuntime * Get(Process &process)
std::shared_ptr< TypeSystemType > dyn_cast_or_null()
Return a shared_ptr<TypeSystemType> if dyn_cast succeeds.
Definition: CompilerType.h:65
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
CompilerType GetTypeTemplateArgument(size_t idx, bool expand_pack=false) const
TypeSystemSPWrapper GetTypeSystem() const
Accessors.
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
CompilerType GetFieldAtIndex(size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const
A uniqued constant string class.
Definition: ConstString.h:40
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:214
A subclass of DataBuffer that stores a data buffer on the heap.
An data extractor class.
Definition: DataExtractor.h:48
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
ExecutionContextScope * GetBestExecutionContextScope() const
Process * GetProcessPtr() const
Returns a pointer to the process object.
const ConstString & GetFilename() const
Filename string const get accessor.
Definition: FileSpec.h:240
A plug-in interface definition class for debugging a process.
Definition: Process.h:341
static lldb::TypeSystemClangSP GetForTarget(Target &target, std::optional< IsolatedASTKind > ast_kind=DefaultAST, bool create_on_demand=true)
Returns the scratch TypeSystemClang for the given target.
An error handling class.
Definition: Status.h:44
bool Success() const
Test for success condition.
Definition: Status.cpp:279
const char * GetData() const
Definition: StreamString.h:43
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:134
ConstString GetName() const
Definition: Symbol.cpp:552
lldb::TypeSummaryCapping GetCapping() const
Definition: TypeSummary.cpp:33
A TypeSystem implementation based on Clang.
virtual lldb::ValueObjectSP GetChildAtIndex(uint32_t idx, bool can_create=true)
virtual uint64_t GetValueAsUnsigned(uint64_t fail_value, bool *success=nullptr)
virtual lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name, bool can_create=true)
lldb::TargetSP GetTargetSP() const
Definition: ValueObject.h:334
virtual lldb::ValueObjectSP GetNonSyntheticValue()
Definition: ValueObject.h:582
uint32_t GetNumChildrenIgnoringErrors(uint32_t max=UINT32_MAX)
Like GetNumChildren but returns 0 on error.
llvm::Expected< uint32_t > CalculateNumChildren() override
Definition: LibCxx.cpp:355
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
Definition: LibCxx.cpp:360
size_t GetIndexOfChildWithName(ConstString name) override
Definition: LibCxx.cpp:375
lldb::ChildCacheState Update() override
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
Definition: LibCxx.cpp:235
LibCxxMapIteratorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
Definition: LibCxx.cpp:228
Formats libcxx's std::unordered_map iterators.
Definition: LibCxx.h:136
LibCxxUnorderedMapIteratorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
Definition: LibCxx.cpp:397
llvm::Expected< uint32_t > CalculateNumChildren() override
Definition: LibCxx.cpp:513
lldb::ChildCacheState Update() override
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
Definition: LibCxx.cpp:404
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
Definition: LibCxx.cpp:518
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
Definition: LibCxx.cpp:575
llvm::Expected< uint32_t > CalculateNumChildren() override
Definition: LibCxx.cpp:570
lldb::ChildCacheState Update() override
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
Definition: LibCxx.cpp:605
LibcxxSharedPtrSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
Definition: LibCxx.cpp:563
size_t GetIndexOfChildWithName(ConstString name) override
Definition: LibCxx.cpp:629
llvm::Expected< uint32_t > CalculateNumChildren() override
Definition: LibCxx.cpp:665
lldb::ChildCacheState Update() override
This function is assumed to always succeed and if it fails, the front-end should know to deal with it...
Definition: LibCxx.cpp:695
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override
Definition: LibCxx.cpp:672
size_t GetIndexOfChildWithName(ConstString name) override
Definition: LibCxx.cpp:723
LibcxxUniquePtrSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
Definition: LibCxx.cpp:648
static bool ReadBufferAndDumpToStream(const ReadBufferAndDumpToStreamOptions &options)
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:82
#define LLDB_INVALID_OFFSET
Definition: lldb-defines.h:93
#define UINT32_MAX
Definition: lldb-defines.h:19
bool FormatStringRef(const llvm::StringRef &format, Stream &s, const SymbolContext *sc, const ExecutionContext *exe_ctx, const Address *addr, ValueObject *valobj, bool function_changed, bool initial_function)
SyntheticChildrenFrontEnd * LibCxxUnorderedMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:539
lldb::ValueObjectSP GetChildMemberWithName(ValueObject &obj, llvm::ArrayRef< ConstString > alternative_names)
Find a child member of obj_sp, trying all alternative names in order.
Definition: LibCxx.cpp:37
bool LibcxxChronoSysSecondsSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1128
bool LibcxxChronoMonthSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1189
SyntheticChildrenFrontEnd * LibcxxUniquePtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:658
bool LibcxxUniquePointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:169
bool LibcxxSmartPointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:127
bool LibcxxStringViewSummaryProviderASCII(ValueObject &valueObj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:1051
bool LibcxxStringViewSummaryProviderUTF16(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:1058
SyntheticChildrenFrontEnd * LibCxxVectorIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:555
bool LibcxxStringViewSummaryProviderUTF32(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:1065
bool LibcxxChronoYearMonthDaySummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1231
bool LibcxxWStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:904
bool LibcxxStringSummaryProviderASCII(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:991
bool LibcxxChronoLocalSecondsSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1134
bool LibcxxWStringViewSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1072
bool LibcxxChronoWeekdaySummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1210
lldb::ValueObjectSP GetFirstValueOfLibCXXCompressedPair(ValueObject &pair)
Definition: LibCxx.cpp:49
bool LibcxxStringSummaryProviderUTF16(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:998
bool LibcxxFunctionSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:79
bool LibcxxStringSummaryProviderUTF32(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:1005
bool LibcxxChronoLocalDaysSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1183
lldb::ValueObjectSP GetSecondValueOfLibCXXCompressedPair(ValueObject &pair)
Definition: LibCxx.cpp:63
bool LibcxxContainerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:733
SyntheticChildrenFrontEnd * LibcxxSharedPtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:641
SyntheticChildrenFrontEnd * LibCxxMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:390
bool LibcxxChronoSysDaysSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1177
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
Definition: SBAddress.h:15
@ eBasicTypeUnsignedLongLong
ChildCacheState
Specifies if children need to be re-computed after a call to SyntheticChildrenFrontEnd::Update.
@ eRefetch
Children need to be recomputed dynamically.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Definition: lldb-forward.h:472
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:381
std::shared_ptr< lldb_private::TypeSystemClang > TypeSystemClangSP
Definition: lldb-forward.h:458
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
Definition: lldb-forward.h:329
std::shared_ptr< lldb_private::Target > TargetSP
Definition: lldb-forward.h:436
uint32_t line
The source line number, or LLDB_INVALID_LINE_NUMBER if there is no line number information.
Definition: LineEntry.h:147
const FileSpec & GetFile() const
Helper to access the file.
Definition: LineEntry.h:134
GetValueForExpressionPathOptions & SetSyntheticChildrenTraversal(SyntheticChildrenTraversal traverse)
Definition: ValueObject.h:248
GetValueForExpressionPathOptions & DontCheckDotVsArrowSyntax()
Definition: ValueObject.h:222