29#include "lldb/Host/Config.h"
53#include "llvm/Support/Compiler.h"
83 : m_parent(&parent), m_update_point(parent.GetUpdatePoint()),
96 : m_update_point(exe_scope), m_manager(&manager),
97 m_address_type_of_ptr_or_ref_children(child_ptr_or_ref_addr_type),
102 const ArchSpec &arch = target_sp->GetArchitecture();
115 bool did_change_formats =
false;
129 if (update_format && !did_change_formats)
160 bool need_compare_checksums =
false;
161 llvm::SmallVector<uint8_t, 16> old_checksum;
164 need_compare_checksums =
true;
167 old_checksum.begin());
176 const uint64_t max_checksum_size = 128;
179 need_compare_checksums =
false;
183 assert(!need_compare_checksums ||
192 }
else if (need_compare_checksums) {
207 "[%s %p] checking for FormatManager revisions. ValueObject "
208 "rev: %d - Global rev: %d",
209 GetName().GetCString(),
static_cast<void *
>(
this),
213 bool any_change =
false;
253 return compiler_type;
262 return compiler_type;
266 if (std::optional<CompilerType> complete_type =
267 runtime->GetRuntimeType(compiler_type)) {
273 return compiler_type;
296 switch (value_type) {
322 sstr.
Printf(
"0x%*.*llx", addr_nibble_size, addr_nibble_size,
341 if (bitfield_bit_size)
352 LazyBool is_logical_true = language->IsLogicalTrue(*
this,
error);
353 switch (is_logical_true) {
356 return (is_logical_true ==
true);
365 error.SetErrorString(
"failed to get a scalar result");
389 if (child !=
nullptr)
390 return child->
GetSP();
397 if (names.size() == 0)
400 for (llvm::StringRef name : names) {
401 root = root->GetChildMemberWithName(name);
410 bool omit_empty_base_classes =
true;
412 omit_empty_base_classes);
424 std::vector<uint32_t> child_indexes;
425 bool omit_empty_base_classes =
true;
430 const size_t num_child_indexes =
432 name, omit_empty_base_classes, child_indexes);
433 if (num_child_indexes == 0)
437 for (uint32_t idx : child_indexes)
439 child_sp = child_sp->GetChildAtIndex(idx, can_create);
449 return children_count <= max ? children_count : max;
456 if (num_children_or_err)
459 return num_children_or_err;
467 return *value_or_err;
474 bool has_children =
false;
477 if (type_info & (eTypeHasChildren | eTypeIsPointer | eTypeIsReference))
492 bool synthetic_array_member,
493 int32_t synthetic_index) {
496 bool omit_empty_base_classes =
true;
497 bool ignore_array_bounds = synthetic_array_member;
498 std::string child_name_str;
499 uint32_t child_byte_size = 0;
500 int32_t child_byte_offset = 0;
501 uint32_t child_bitfield_bit_size = 0;
502 uint32_t child_bitfield_bit_offset = 0;
503 bool child_is_base_class =
false;
504 bool child_is_deref_of_parent =
false;
505 uint64_t language_flags = 0;
507 const bool transparent_pointers = !synthetic_array_member;
513 &exe_ctx, idx, transparent_pointers, omit_empty_base_classes,
514 ignore_array_bounds, child_name_str, child_byte_size, child_byte_offset,
515 child_bitfield_bit_size, child_bitfield_bit_offset, child_is_base_class,
516 child_is_deref_of_parent,
this, language_flags);
517 if (child_compiler_type) {
519 child_byte_offset += child_byte_size * synthetic_index;
522 if (!child_name_str.empty())
523 child_name.
SetCString(child_name_str.c_str());
526 *
this, child_compiler_type, child_name, child_byte_size,
527 child_byte_offset, child_bitfield_bit_size, child_bitfield_bit_offset,
534 if (!valobj && synthetic_array_member) {
536 valobj = synth_valobj_sp
546 std::string &destination,
553 std::string &destination,
561 destination =
"<incomplete type>";
591 summary_ptr->
FormatObject(
this, destination, actual_options);
594 return !destination.empty();
617 bool is_char_arr_ptr(type_flags.
AnySet(eTypeIsArray | eTypeIsPointer) &&
618 pointee_or_element_compiler_type.
IsCharType());
619 if (!is_char_arr_ptr)
623 if (type_flags.
Test(eTypeIsArray))
632 uint32_t item_count) {
634 const uint32_t type_info =
GetTypeInfo(&pointee_or_element_compiler_type);
635 const bool is_pointer_type = type_info & eTypeIsPointer;
636 const bool is_array_type = type_info & eTypeIsArray;
637 if (!(is_pointer_type || is_array_type))
645 std::optional<uint64_t> item_type_size =
650 const uint64_t bytes = item_count * *item_type_size;
651 const uint64_t offset = item_idx * *item_type_size;
653 if (item_idx == 0 && item_count == 1)
655 if (is_pointer_type) {
658 if (
error.Fail() || pointee_sp.get() ==
nullptr)
660 return pointee_sp->GetData(data,
error);
663 if (child_sp.get() ==
nullptr)
666 return child_sp->GetData(data,
error);
684 addr = addr + offset;
686 module_sp->ResolveFileAddress(addr, so_addr);
693 if (
error.Success()) {
707 if (
error.Success() || bytes_read > 0) {
716 if (max_bytes && *max_bytes > offset) {
717 size_t bytes_read = std::min<uint64_t>(*max_bytes - offset, bytes);
721 heap_buf_ptr->
CopyData((uint8_t *)(addr + offset), bytes_read);
756 error.SetErrorString(
"unable to read value");
763 const size_t byte_size =
GetByteSize().value_or(0);
767 switch (value_type) {
769 error.SetErrorString(
"invalid location");
776 error.SetErrorStringWithFormat(
"unable to set scalar value: %s",
790 if (!
error.Success())
792 if (bytes_written != byte_size) {
793 error.SetErrorString(
"unable to write value to memory");
820 llvm::StringRef src = source.
GetString();
821 src = src.rtrim(
'\0');
822 destination = std::make_shared<DataBufferHeap>(src.size(), 0);
823 memcpy(destination->GetBytes(), src.data(), src.size());
827std::pair<size_t, bool>
830 bool was_capped =
false;
836 s <<
"<no target to read from>";
837 error.SetErrorString(
"no target to read from");
839 return {0, was_capped};
844 size_t bytes_read = 0;
845 size_t total_bytes_read = 0;
850 if (type_flags.
AnySet(eTypeIsArray | eTypeIsPointer) &&
856 bool capped_data =
false;
857 const bool is_array = type_flags.
Test(eTypeIsArray);
860 uint64_t array_size = 0;
861 if (compiler_type.
IsArrayType(
nullptr, &array_size)) {
862 cstr_len = array_size;
863 if (cstr_len > max_length) {
865 cstr_len = max_length;
877 if (cstr ==
nullptr) {
878 s <<
"<invalid address>";
879 error.SetErrorString(
"invalid address");
881 return {0, was_capped};
883 s << llvm::StringRef(cstr, cstr_len);
885 return {cstr_len, was_capped};
887 s <<
"<invalid address>";
888 error.SetErrorString(
"invalid address");
890 return {0, was_capped};
894 Address cstr_so_addr(cstr_address);
896 if (cstr_len > 0 && honor_array) {
904 total_bytes_read = bytes_read;
905 for (
size_t offset = 0; offset < bytes_read; offset++)
911 cstr_len = max_length;
912 const size_t k_max_buf_size = 64;
916 int cstr_len_displayed = -1;
917 bool capped_cstr =
false;
922 while ((bytes_read =
GetPointeeData(data, offset, k_max_buf_size)) > 0) {
923 total_bytes_read += bytes_read;
924 const char *cstr = data.
PeekCStr(0);
925 size_t len = strnlen(cstr, k_max_buf_size);
926 if (cstr_len_displayed < 0)
927 cstr_len_displayed = len;
931 cstr_len_displayed += len;
932 if (len > bytes_read)
937 for (
size_t offset = 0; offset < bytes_read; offset++)
940 if (len < k_max_buf_size)
943 if (len >= cstr_len) {
952 if (cstr_len_displayed >= 0) {
958 error.SetErrorString(
"not a string object");
959 s <<
"<not a string object>";
962 return {total_bytes_read, was_capped};
979 auto get_object_description = [&](
LanguageType language) ->
const char * {
982 if (runtime->GetObjectDescription(s, *
this)) {
992 if (
const char *desc = get_object_description(native_language))
1003 std::string &destination) {
1011 std::string &destination) {
1029 my_format = reg_info->
format;
1039 format_sp = std::make_shared<TypeFormatImpl_Format>(my_format);
1099 if (flags.
AnySet(eTypeIsArray | eTypeIsPointer) &&
1106 if (flags.
Test(eTypeIsArray)) {
1132 bool do_dump_error) {
1145 bool allow_special =
1147 const bool only_special =
false;
1149 if (allow_special) {
1150 if (flags.
AnySet(eTypeIsArray | eTypeIsPointer) &&
1163 std::pair<size_t, bool> read_string =
1167 lldb_private::formatters::StringPrinter::
1168 ReadBufferAndDumpToStreamOptions options(*
this);
1172 options.SetStream(&s);
1173 options.SetPrefixToken(
nullptr);
1174 options.SetQuote(
'"');
1175 options.SetSourceSize(buffer_sp->GetByteSize());
1176 options.SetIsTruncated(read_string.second);
1179 lldb_private::formatters::StringPrinter::StringElementType::ASCII>(
1181 return !
error.Fail();
1189 if (flags.
Test(eTypeIsArray)) {
1195 for (
size_t low = 0; low < count; low++) {
1202 s <<
"<invalid child>";
1205 child->DumpPrintableRepresentation(
1236 for (
size_t low = 0; low < count; low++) {
1243 s <<
"<invalid child>";
1246 child->DumpPrintableRepresentation(
1278 bool var_success =
false;
1281 llvm::StringRef str;
1292 switch (val_obj_display) {
1357 else if (val_obj_display ==
1359 s.
PutCString(
"<not a valid Objective-C object>");
1364 s.
PutCString(
"<no printable representation>");
1392 if (scalar_is_load_address) {
1450 error.SetErrorString(
"unable to read value");
1457 const size_t byte_size =
GetByteSize().value_or(0);
1464 }
else if (byte_size <= 16) {
1470 if (
error.Success()) {
1471 switch (value_type) {
1482 target_addr, new_scalar, byte_size,
error);
1483 if (!
error.Success())
1485 if (bytes_written != byte_size) {
1486 error.SetErrorString(
"unable to write value to memory");
1499 bool success = new_scalar.
GetData(new_data);
1509 error.SetErrorString(
"invalid location");
1520 error.SetErrorString(
"unable to write aggregate data type");
1542 std::map<ConstString, ValueObject *>::const_iterator pos =
1545 synthetic_child_sp = pos->second->GetSP();
1546 return synthetic_child_sp;
1569 if (runtime->IsAllowedRuntimeValue(
GetName()))
1577 return language->IsNilReference(*
this);
1584 return language->IsUninitializedReference(*
this);
1602 std::string index_str = llvm::formatv(
"[{0}]", index);
1607 if (!synthetic_child_sp) {
1614 if (synthetic_child) {
1616 synthetic_child_sp = synthetic_child->
GetSP();
1617 synthetic_child_sp->SetName(
ConstString(index_str));
1618 synthetic_child_sp->m_flags.m_is_array_item_for_pointer =
true;
1622 return synthetic_child_sp;
1629 std::string index_str = llvm::formatv(
"[{0}-{1}]", from, to);
1634 if (!synthetic_child_sp) {
1635 uint32_t bit_field_size = to - from + 1;
1636 uint32_t bit_field_offset = from;
1639 GetByteSize().value_or(0) * 8 - bit_field_size - bit_field_offset;
1644 0, bit_field_size, bit_field_offset,
false,
false,
1648 if (synthetic_child) {
1650 synthetic_child_sp = synthetic_child->
GetSP();
1651 synthetic_child_sp->SetName(
ConstString(index_str));
1652 synthetic_child_sp->m_flags.m_is_bitfield_for_scalar =
true;
1656 return synthetic_child_sp;
1660 uint32_t offset,
const CompilerType &type,
bool can_create,
1665 if (name_const_str.
IsEmpty()) {
1666 name_const_str.
SetString(
"@" + std::to_string(offset));
1673 if (synthetic_child_sp.get())
1674 return synthetic_child_sp;
1680 std::optional<uint64_t> size =
1687 if (synthetic_child) {
1689 synthetic_child_sp = synthetic_child->
GetSP();
1690 synthetic_child_sp->SetName(name_const_str);
1691 synthetic_child_sp->m_flags.m_is_child_at_offset =
true;
1693 return synthetic_child_sp;
1702 if (name_const_str.
IsEmpty()) {
1704 snprintf(name_str,
sizeof(name_str),
"base%s@%i",
1713 if (synthetic_child_sp.get())
1714 return synthetic_child_sp;
1719 const bool is_base_class =
true;
1722 std::optional<uint64_t> size =
1729 if (synthetic_child) {
1731 synthetic_child_sp = synthetic_child->
GetSP();
1732 synthetic_child_sp->SetName(name_const_str);
1734 return synthetic_child_sp;
1742 if (!expression || !expression[0])
1744 if (expression[0] ==
'.')
1745 return expression + 1;
1746 if (expression[0] ==
'-' && expression[1] ==
'>')
1747 return expression + 2;
1759 if (!synthetic_child_sp) {
1763 expression,
nullptr,
nullptr,
1769 if (synthetic_child_sp.get()) {
1773 synthetic_child_sp->SetName(
1777 return synthetic_child_sp;
1782 if (target_sp && !target_sp->GetEnableSyntheticValue()) {
1888 uint64_t load_addr =
1909 if (is_deref_of_parent &&
1932 if (!is_deref_of_parent) {
1934 if (non_base_class_parent &&
1938 if (non_base_class_parent_compiler_type) {
1943 const uint32_t non_base_class_parent_type_info =
1944 non_base_class_parent_compiler_type.
GetTypeInfo();
1946 if (non_base_class_parent_type_info & eTypeIsPointer) {
1948 }
else if ((non_base_class_parent_type_info & eTypeHasChildren) &&
1949 !(non_base_class_parent_type_info & eTypeIsArray)) {
1962 if (is_deref_of_parent &&
1982 expression, reason_to_stop ? reason_to_stop : &dummy_reason_to_stop,
1983 final_value_type ? final_value_type : &dummy_final_value_type, options,
1984 final_task_on_target ? final_task_on_target
1985 : &dummy_final_task_on_target);
1987 if (!final_task_on_target ||
1991 if (ret_val.get() &&
1992 ((final_value_type ? *final_value_type : dummy_final_value_type) ==
1996 if ((final_task_on_target ? *final_task_on_target
1997 : dummy_final_task_on_target) ==
2001 if (
error.Fail() || !final_value.get()) {
2005 if (final_value_type)
2009 if (final_task_on_target)
2014 if (*final_task_on_target ==
2018 if (
error.Fail() || !final_value.get()) {
2022 if (final_value_type)
2026 if (final_task_on_target)
2046 llvm::StringRef remainder = expression;
2049 llvm::StringRef temp_expression = remainder;
2051 CompilerType root_compiler_type = root->GetCompilerType();
2053 Flags pointee_compiler_type_info;
2055 Flags root_compiler_type_info(
2056 root_compiler_type.
GetTypeInfo(&pointee_compiler_type));
2057 if (pointee_compiler_type)
2060 if (temp_expression.empty()) {
2065 switch (temp_expression.front()) {
2067 temp_expression = temp_expression.drop_front();
2069 root_compiler_type_info.
Test(eTypeIsPointer))
2079 if (root_compiler_type_info.
Test(eTypeIsObjC) &&
2082 root_compiler_type_info.
Test(eTypeIsPointer) &&
2089 if (!temp_expression.starts_with(
">")) {
2100 temp_expression.front() ==
'.' &&
2101 root_compiler_type_info.
Test(eTypeIsPointer))
2111 temp_expression = temp_expression.drop_front();
2113 size_t next_sep_pos = temp_expression.find_first_of(
"-.[", 1);
2114 if (next_sep_pos == llvm::StringRef::npos)
2117 llvm::StringRef child_name = temp_expression;
2119 root->GetChildMemberWithName(child_name);
2121 if (child_valobj_sp.get())
2126 return child_valobj_sp;
2134 if (root->IsSynthetic()) {
2135 child_valobj_sp = root->GetNonSyntheticValue();
2136 if (child_valobj_sp.get())
2138 child_valobj_sp->GetChildMemberWithName(child_name);
2143 if (!root->IsSynthetic()) {
2144 child_valobj_sp = root->GetSyntheticValue();
2145 if (child_valobj_sp.get())
2147 child_valobj_sp->GetChildMemberWithName(child_name);
2152 if (root->IsSynthetic()) {
2153 child_valobj_sp = root->GetNonSyntheticValue();
2154 if (child_valobj_sp.get())
2156 child_valobj_sp->GetChildMemberWithName(child_name);
2158 child_valobj_sp = root->GetSyntheticValue();
2159 if (child_valobj_sp.get())
2161 child_valobj_sp->GetChildMemberWithName(child_name);
2170 if (child_valobj_sp.get())
2175 return child_valobj_sp;
2184 llvm::StringRef next_separator = temp_expression.substr(next_sep_pos);
2185 llvm::StringRef child_name = temp_expression.slice(0, next_sep_pos);
2188 root->GetChildMemberWithName(child_name);
2189 if (child_valobj_sp.get())
2191 root = child_valobj_sp;
2192 remainder = next_separator;
2202 if (root->IsSynthetic()) {
2203 child_valobj_sp = root->GetNonSyntheticValue();
2204 if (child_valobj_sp.get())
2206 child_valobj_sp->GetChildMemberWithName(child_name);
2211 if (!root->IsSynthetic()) {
2212 child_valobj_sp = root->GetSyntheticValue();
2213 if (child_valobj_sp.get())
2215 child_valobj_sp->GetChildMemberWithName(child_name);
2220 if (root->IsSynthetic()) {
2221 child_valobj_sp = root->GetNonSyntheticValue();
2222 if (child_valobj_sp.get())
2224 child_valobj_sp->GetChildMemberWithName(child_name);
2226 child_valobj_sp = root->GetSyntheticValue();
2227 if (child_valobj_sp.get())
2229 child_valobj_sp->GetChildMemberWithName(child_name);
2238 if (child_valobj_sp.get())
2240 root = child_valobj_sp;
2241 remainder = next_separator;
2254 if (!root_compiler_type_info.
Test(eTypeIsArray) &&
2255 !root_compiler_type_info.
Test(eTypeIsPointer) &&
2256 !root_compiler_type_info.
Test(
2259 if (!root_compiler_type_info.
Test(
2281 if (temp_expression[1] ==
2284 if (!root_compiler_type_info.
Test(eTypeIsArray)) {
2300 size_t close_bracket_position = temp_expression.find(
']', 1);
2301 if (close_bracket_position ==
2302 llvm::StringRef::npos)
2310 llvm::StringRef bracket_expr =
2311 temp_expression.slice(1, close_bracket_position);
2315 assert(!bracket_expr.empty());
2317 if (!bracket_expr.contains(
'-')) {
2321 unsigned long index = 0;
2322 if (bracket_expr.getAsInteger(0, index)) {
2330 if (root_compiler_type_info.
Test(eTypeIsArray)) {
2331 ValueObjectSP child_valobj_sp = root->GetChildAtIndex(index);
2332 if (!child_valobj_sp)
2333 child_valobj_sp = root->GetSyntheticArrayMember(index,
true);
2334 if (!child_valobj_sp)
2335 if (root->HasSyntheticValue() &&
2336 llvm::expectedToStdOptional(
2337 root->GetSyntheticValue()->GetNumChildren())
2338 .value_or(0) > index)
2340 root->GetSyntheticValue()->GetChildAtIndex(index);
2341 if (child_valobj_sp) {
2342 root = child_valobj_sp;
2344 temp_expression.substr(close_bracket_position + 1);
2353 }
else if (root_compiler_type_info.
Test(eTypeIsPointer)) {
2365 pointee_compiler_type_info.
Test(eTypeIsScalar)) {
2367 root = root->Dereference(
error);
2368 if (
error.Fail() || !root) {
2378 if (root->GetCompilerType().GetMinimumLanguage() ==
2380 pointee_compiler_type_info.
AllClear(eTypeIsPointer) &&
2381 root->HasSyntheticValue() &&
2384 SyntheticChildrenTraversal::ToSynthetic ||
2387 SyntheticChildrenTraversal::Both)) {
2388 root = root->GetSyntheticValue()->GetChildAtIndex(index);
2390 root = root->GetSyntheticArrayMember(index,
true);
2398 temp_expression.substr(close_bracket_position + 1);
2403 }
else if (root_compiler_type_info.
Test(eTypeIsScalar)) {
2404 root = root->GetSyntheticBitFieldChild(index, index,
true);
2418 }
else if (root_compiler_type_info.
Test(eTypeIsVector)) {
2419 root = root->GetChildAtIndex(index);
2427 temp_expression.substr(close_bracket_position + 1);
2433 SyntheticChildrenTraversal::ToSynthetic ||
2436 SyntheticChildrenTraversal::Both) {
2437 if (root->HasSyntheticValue())
2438 root = root->GetSyntheticValue();
2439 else if (!root->IsSynthetic()) {
2454 root = root->GetChildAtIndex(index);
2462 temp_expression.substr(close_bracket_position + 1);
2474 llvm::StringRef sleft, sright;
2475 unsigned long low_index, high_index;
2476 std::tie(sleft, sright) = bracket_expr.split(
'-');
2477 if (sleft.getAsInteger(0, low_index) ||
2478 sright.getAsInteger(0, high_index)) {
2485 if (low_index > high_index)
2486 std::swap(low_index, high_index);
2488 if (root_compiler_type_info.
Test(
2491 root = root->GetSyntheticBitFieldChild(low_index, high_index,
true);
2503 }
else if (root_compiler_type_info.
Test(
2510 pointee_compiler_type_info.
Test(eTypeIsScalar)) {
2512 root = root->Dereference(
error);
2513 if (
error.Fail() || !root) {
2593 result_sp =
GetSP();
2596 bool is_synthetic = result_sp->IsSynthetic();
2597 if (synthValue && !is_synthetic) {
2598 if (
auto synth_sp = result_sp->GetSyntheticValue())
2601 if (!synthValue && is_synthetic) {
2602 if (
auto non_synth_sp = result_sp->GetNonSyntheticValue())
2603 return non_synth_sp;
2614 if (is_pointer_or_reference_type) {
2615 bool omit_empty_base_classes =
true;
2616 bool ignore_array_bounds =
false;
2618 std::string child_name_str;
2619 uint32_t child_byte_size = 0;
2620 int32_t child_byte_offset = 0;
2621 uint32_t child_bitfield_bit_size = 0;
2622 uint32_t child_bitfield_bit_offset = 0;
2623 bool child_is_base_class =
false;
2624 bool child_is_deref_of_parent =
false;
2625 const bool transparent_pointers =
false;
2628 uint64_t language_flags = 0;
2633 &exe_ctx, 0, transparent_pointers, omit_empty_base_classes,
2634 ignore_array_bounds, child_name_str, child_byte_size, child_byte_offset,
2635 child_bitfield_bit_size, child_bitfield_bit_offset, child_is_base_class,
2636 child_is_deref_of_parent,
this, language_flags);
2637 if (child_compiler_type && child_byte_size) {
2639 if (!child_name_str.empty())
2640 child_name.
SetCString(child_name_str.c_str());
2643 *
this, child_compiler_type, child_name, child_byte_size,
2644 child_byte_offset, child_bitfield_bit_size, child_bitfield_bit_offset,
2658 if (child_compiler_type) {
2660 if (!child_name_str.empty())
2661 child_name.
SetCString(child_name_str.c_str());
2664 *
this, child_compiler_type, child_name, child_byte_size,
2665 child_byte_offset, child_bitfield_bit_size,
2666 child_bitfield_bit_offset, child_is_base_class,
2686 if (is_pointer_or_reference_type)
2687 error.SetErrorStringWithFormat(
"dereference failed: (%s) %s",
2691 error.SetErrorStringWithFormat(
"not a pointer or reference type: (%s) %s",
2703 const bool scalar_is_load_address =
false;
2707 switch (address_type) {
2711 error.SetErrorStringWithFormat(
"'%s' is not in memory",
2718 if (compiler_type) {
2719 std::string name(1,
'&');
2734 error.SetErrorStringWithFormat(
"'%s' doesn't have a valid address",
2769 return DoCast(compiler_type);
2771 error.SetErrorString(
"Can only cast to a type that is equal to or smaller "
2772 "than the orignal type.");
2816 : m_mod_id(), m_exe_ctx_ref() {
2823 process_sp = target_sp->GetProcessSP();
2833 thread_sp = process_sp->GetThreadList().GetSelectedThread();
2853 : m_mod_id(), m_exe_ctx_ref(rhs.m_exe_ctx_ref) {}
2866 bool accept_invalid_exe_ctx) {
2869 const bool thread_and_frame_only_if_stopped =
true;
2871 m_exe_ctx_ref.Lock(thread_and_frame_only_if_stopped));
2878 if (process ==
nullptr)
2890 bool changed =
false;
2891 const bool was_valid = m_mod_id.
IsValid();
2893 if (m_mod_id == current_mod_id) {
2898 m_mod_id = current_mod_id;
2899 m_needs_update =
true;
2909 if (!accept_invalid_exe_ctx) {
2910 if (m_exe_ctx_ref.HasThreadRef()) {
2911 ThreadSP thread_sp(m_exe_ctx_ref.GetThreadSP());
2913 if (m_exe_ctx_ref.HasFrameRef()) {
2918 changed = was_valid;
2924 changed = was_valid;
2933 ProcessSP process_sp(m_exe_ctx_ref.GetProcessSP());
2935 m_mod_id = process_sp->GetModID();
2936 m_needs_update =
false;
2973 llvm::StringRef expression,
2980 llvm::StringRef name, llvm::StringRef expression,
2986 if (expression.empty())
2988 target_sp->EvaluateExpression(expression, exe_ctx.
GetFrameSP().get(),
2989 retval_sp, options);
2990 if (retval_sp && !name.empty())
3007 if (ptr_result_valobj_sp) {
3008 ptr_result_valobj_sp->GetValue().SetValueType(
3011 ptr_result_valobj_sp = ptr_result_valobj_sp->Dereference(err);
3012 if (ptr_result_valobj_sp && !name.empty())
3015 return ptr_result_valobj_sp;
3029 if (new_value_sp && !name.empty())
3031 return new_value_sp;
3071 while (with_dv_info) {
3074 with_dv_info = with_dv_info->
m_parent;
3081 while (with_fmt_info) {
3084 with_fmt_info = with_fmt_info->
m_parent;
3096 frame_sp->GetSymbolContext(eSymbolContextCompUnit));
3098 type = cu->GetLanguage();
3132 target_sp->GetPersistentExpressionStateForLanguage(
3135 if (!persistent_state)
3145 persistent_var_sp->m_live_sp = persistent_var_sp->m_frozen_sp;
3148 return persistent_var_sp->GetValueObject();
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG_ERRORV(log, error,...)
#define LLDB_LOGF(log,...)
static user_id_t g_value_obj_uid
static bool CopyStringDataToBufferSP(const StreamString &source, lldb::WritableDataBufferSP &destination)
static const char * SkipLeadingExpressionPathSeparators(const char *expression)
A section + offset based address class.
An architecture specification class.
uint32_t GetAddressByteSize() const
Returns the size in bytes of an address of the current architecture.
lldb::ByteOrder GetByteOrder() const
Returns the byte order for the architecture specification.
void ManageObject(T *new_object)
A class that describes a compilation unit.
Generic representation of a type in a programming language.
CompilerType GetChildCompilerTypeAtIndex(ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers, bool omit_empty_base_classes, bool ignore_array_bounds, std::string &child_name, uint32_t &child_byte_size, int32_t &child_byte_offset, uint32_t &child_bitfield_bit_size, uint32_t &child_bitfield_bit_offset, bool &child_is_base_class, bool &child_is_deref_of_parent, ValueObject *valobj, uint64_t &language_flags) const
bool IsPossibleDynamicType(CompilerType *target_type, bool check_cplusplus, bool check_objc) const
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
lldb::Encoding GetEncoding(uint64_t &count) const
bool IsArrayType(CompilerType *element_type=nullptr, uint64_t *size=nullptr, bool *is_incomplete=nullptr) const
size_t GetIndexOfChildMemberWithName(llvm::StringRef name, bool omit_empty_base_classes, std::vector< uint32_t > &child_indexes) const
Lookup a child member given a name.
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
ConstString GetTypeName(bool BaseOnly=false) const
uint32_t GetIndexOfChildWithName(llvm::StringRef name, bool omit_empty_base_classes) const
Lookup a child given a name.
lldb::Format GetFormat() const
CompilerType GetPointeeType() const
If this type is a pointer type, return the type that the pointer points to, else return an invalid ty...
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
A uniqued constant string class.
void SetCString(const char *cstr)
Set the C string value.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
bool IsEmpty() const
Test for empty string.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
void SetString(llvm::StringRef s)
const char * GetCString() const
Get the string value as a C string.
A subclass of DataBuffer that stores a data buffer on the heap.
lldb::offset_t SetByteSize(lldb::offset_t byte_size)
Set the number of bytes in the data buffer.
void CopyData(const void *src, lldb::offset_t src_len)
Makes a copy of the src_len bytes in src.
static lldb::TypeSummaryImplSP GetSummaryFormat(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
static lldb::TypeFormatImplSP GetFormat(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
static lldb::SyntheticChildrenSP GetSyntheticChildren(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
static uint32_t GetCurrentRevision()
A class that describes the declaration location of a lldb object.
void Clear()
Clear the object's state.
void SetThreadSP(const lldb::ThreadSP &thread_sp)
Set accessor that creates a weak reference to the thread referenced in thread_sp.
void SetFrameSP(const lldb::StackFrameSP &frame_sp)
Set accessor that creates a weak reference to the frame referenced in frame_sp.
void SetTargetSP(const lldb::TargetSP &target_sp)
Set accessor that creates a weak reference to the target referenced in target_sp.
void SetProcessSP(const lldb::ProcessSP &process_sp)
Set accessor that creates a weak reference to the process referenced in process_sp.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
virtual lldb::TargetSP CalculateTarget()=0
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
ExecutionContextScope * GetBestExecutionContextScope() const
const lldb::TargetSP & GetTargetSP() const
Get accessor to get the target shared pointer.
uint32_t GetAddressByteSize() const
const lldb::ProcessSP & GetProcessSP() const
Get accessor to get the process shared pointer.
lldb::ByteOrder GetByteOrder() const
const lldb::StackFrameSP & GetFrameSP() const
Get accessor to get the frame shared pointer.
Target * GetTargetPtr() const
Returns a pointer to the target object.
const lldb::ThreadSP & GetThreadSP() const
Get accessor to get the thread shared pointer.
Process * GetProcessPtr() const
Returns a pointer to the process object.
@ EVIsProgramReference
This variable is a reference to a (possibly invalid) area managed by the target program.
bool AllClear(ValueType mask) const
Test if all bits in mask are clear.
void Reset(ValueType flags)
Set accessor for all flags.
bool Test(ValueType bit) const
Test a single flag bit.
bool AnySet(ValueType mask) const
Test one or more flags.
static Language * FindPlugin(lldb::LanguageType language)
static bool LanguageIsCFamily(lldb::LanguageType language)
Equivalent to LanguageIsC||LanguageIsObjC||LanguageIsCPlusPlus.
static bool LanguageIsObjC(lldb::LanguageType language)
virtual lldb::ExpressionVariableSP CreatePersistentVariable(const lldb::ValueObjectSP &valobj_sp)=0
virtual ConstString GetNextPersistentVariableName(bool is_error=false)=0
Return a new persistent variable name with the specified prefix.
uint32_t GetStopID() const
A plug-in interface definition class for debugging a process.
ProcessModID GetModID() const
Get the Modification ID of the process.
virtual size_t ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, Status &error)
Read of memory from a process.
bool IsPossibleDynamicValue(ValueObject &in_value)
LanguageRuntime * GetLanguageRuntime(lldb::LanguageType language)
size_t WriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size, Status &error)
Write memory to a process.
size_t WriteScalarToMemory(lldb::addr_t vm_addr, const Scalar &scalar, size_t size, Status &error)
Write all or part of a scalar value to memory.
Status SetValueFromData(const DataExtractor &data, lldb::Encoding encoding, size_t byte_size)
unsigned long long ULongLong(unsigned long long fail_value=0) const
bool GetData(DataExtractor &data, size_t limit_byte_size=UINT32_MAX) const
long long SLongLong(long long fail_value=0) const
bool ExtractBitfield(uint32_t bit_size, uint32_t bit_offset)
Status SetValueFromCString(const char *s, lldb::Encoding encoding, size_t byte_size)
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.
void SetErrorString(llvm::StringRef err_str)
Set the current error string to err_str.
bool Success() const
Test for success condition.
const char * GetData() const
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
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.
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
Defines a symbol context baton that can be handed other debug core functions.
CompileUnit * comp_unit
The CompileUnit for a given query.
uint32_t GetMaximumSizeOfStringSummary() const
size_t ReadMemory(const Address &addr, void *dst, size_t dst_len, Status &error, bool force_live_memory=false, lldb::addr_t *load_addr_ptr=nullptr)
virtual bool FormatObject(ValueObject *valobj, std::string &dest, const TypeSummaryOptions &options)=0
lldb::LanguageType GetLanguage() const
TypeSummaryOptions & SetLanguage(lldb::LanguageType)
static lldb::ValueObjectSP Create(ValueObject &parent, ConstString name, const CompilerType &cast_type)
A child of another ValueObject.
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS)
A ValueObject that represents memory at a given address, viewed as some set lldb type.
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, llvm::StringRef name, const Address &address, lldb::TypeSP &type_sp)
static lldb::ValueObjectSP Create(ValueObject &parent)
ValueObject * GetChildAtIndex(uint32_t idx)
void SetChildrenCount(size_t count)
size_t GetChildrenCount()
void SetChildAtIndex(size_t idx, ValueObject *valobj)
bool HasChildAtIndex(size_t idx)
bool SyncWithProcessState(bool accept_invalid_exe_ctx)
ExecutionContextRef m_exe_ctx_ref
AddressType m_address_type_of_ptr_or_ref_children
void SetValueIsValid(bool valid)
EvaluationPoint m_update_point
Stores both the stop id and the full context at which this value was last updated.
lldb::TypeSummaryImplSP GetSummaryFormat()
llvm::SmallVector< uint8_t, 16 > m_value_checksum
virtual uint32_t GetBitfieldBitSize()
void ClearUserVisibleData(uint32_t items=ValueObject::eClearUserVisibleDataItemsAllStrings)
ValueObject * FollowParentChain(std::function< bool(ValueObject *)>)
Given a ValueObject, loop over itself and its parent, and its parent's parent, .
CompilerType m_override_type
If the type of the value object should be overridden, the type to impose.
lldb::ValueObjectSP Cast(const CompilerType &compiler_type)
const EvaluationPoint & GetUpdatePoint() const
void AddSyntheticChild(ConstString key, ValueObject *valobj)
virtual uint64_t GetData(DataExtractor &data, Status &error)
uint32_t m_last_format_mgr_revision
friend class ValueObjectSynthetic
bool DumpPrintableRepresentation(Stream &s, ValueObjectRepresentationStyle val_obj_display=eValueObjectRepresentationStyleSummary, lldb::Format custom_format=lldb::eFormatInvalid, PrintableRepresentationSpecialCases special=PrintableRepresentationSpecialCases::eAllow, bool do_dump_error=true)
ValueObject * m_deref_valobj
virtual lldb::ValueObjectSP GetChildAtIndex(uint32_t idx, bool can_create=true)
virtual lldb::DynamicValueType GetDynamicValueTypeImpl()
lldb::addr_t GetPointerValue(AddressType *address_type=nullptr)
PrintableRepresentationSpecialCases
virtual bool GetIsConstant() const
virtual bool MightHaveChildren()
Find out if a ValueObject might have children.
static lldb::ValueObjectSP CreateValueObjectFromExpression(llvm::StringRef name, llvm::StringRef expression, const ExecutionContext &exe_ctx)
virtual bool IsDereferenceOfParent()
CompilerType GetCompilerType()
void SetValueFormat(lldb::TypeFormatImplSP format)
virtual void CalculateSyntheticValue()
void SetPreferredDisplayLanguage(lldb::LanguageType lt)
struct lldb_private::ValueObject::Bitflags m_flags
ValueObject(ExecutionContextScope *exe_scope, ValueObjectManager &manager, AddressType child_ptr_or_ref_addr_type=eAddressTypeLoad)
Use this constructor to create a "root variable object".
std::string m_summary_str
Cached summary string that will get cleared if/when the value is updated.
virtual lldb::ValueObjectSP DoCast(const CompilerType &compiler_type)
lldb::ValueObjectSP GetSP()
ChildrenManager m_children
virtual lldb::ValueObjectSP CastPointerType(const char *name, CompilerType &ast_type)
Status m_error
An error object that can describe any errors that occur when updating values.
virtual size_t GetPointeeData(DataExtractor &data, uint32_t item_idx=0, uint32_t item_count=1)
lldb::ValueObjectSP GetSyntheticValue()
ValueObjectManager * m_manager
This object is managed by the root object (any ValueObject that gets created without a parent....
lldb::ValueObjectSP GetSyntheticBitFieldChild(uint32_t from, uint32_t to, bool can_create)
lldb::ProcessSP GetProcessSP() const
lldb::ValueObjectSP GetSyntheticChild(ConstString key) const
ExpressionPathScanEndReason
@ eExpressionPathScanEndReasonArrowInsteadOfDot
-> used when . should be used.
@ eExpressionPathScanEndReasonDereferencingFailed
Impossible to apply * operator.
@ eExpressionPathScanEndReasonNoSuchChild
Child element not found.
@ eExpressionPathScanEndReasonUnknown
@ eExpressionPathScanEndReasonDotInsteadOfArrow
. used when -> should be used.
@ eExpressionPathScanEndReasonEndOfString
Out of data to parse.
@ eExpressionPathScanEndReasonBitfieldRangeOperatorMet
[] is good for bitfields, but I cannot parse after it.
@ eExpressionPathScanEndReasonRangeOperatorNotAllowed
[] not allowed by options.
@ eExpressionPathScanEndReasonEmptyRangeNotAllowed
[] only allowed for arrays.
@ eExpressionPathScanEndReasonRangeOperatorInvalid
[] not valid on objects other than scalars, pointers or arrays.
@ eExpressionPathScanEndReasonUnexpectedSymbol
Something is malformed in he expression.
@ eExpressionPathScanEndReasonArrayRangeOperatorMet
[] is good for arrays, but I cannot parse it.
@ eExpressionPathScanEndReasonSyntheticValueMissing
getting the synthetic children failed.
@ eExpressionPathScanEndReasonTakingAddressFailed
Impossible to apply & operator.
@ eExpressionPathScanEndReasonFragileIVarNotAllowed
ObjC ivar expansion not allowed.
virtual bool UpdateValue()=0
lldb::Format GetFormat() const
virtual lldb::VariableSP GetVariable()
@ eExpressionPathAftermathNothing
Just return it.
@ eExpressionPathAftermathDereference
Dereference the target.
@ eExpressionPathAftermathTakeAddress
Take target's address.
virtual std::optional< uint64_t > GetByteSize()=0
virtual size_t GetIndexOfChildWithName(llvm::StringRef name)
ValueObject * GetNonBaseClassParent()
lldb::ValueObjectSP GetValueForExpressionPath(llvm::StringRef expression, ExpressionPathScanEndReason *reason_to_stop=nullptr, ExpressionPathEndResultType *final_value_type=nullptr, const GetValueForExpressionPathOptions &options=GetValueForExpressionPathOptions::DefaultOptions(), ExpressionPathAftermath *final_task_on_target=nullptr)
virtual lldb::ValueObjectSP GetSyntheticChildAtOffset(uint32_t offset, const CompilerType &type, bool can_create, ConstString name_const_str=ConstString())
virtual void CalculateDynamicValue(lldb::DynamicValueType use_dynamic)
bool IsPossibleDynamicType()
DataExtractor m_data
A data extractor that can be used to extract the value.
virtual CompilerType GetCompilerTypeImpl()=0
virtual lldb::ValueObjectSP GetSyntheticBase(uint32_t offset, const CompilerType &type, bool can_create, ConstString name_const_str=ConstString())
virtual uint64_t GetValueAsUnsigned(uint64_t fail_value, bool *success=nullptr)
@ eGetExpressionPathFormatDereferencePointers
@ eGetExpressionPathFormatHonorPointers
virtual lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name, bool can_create=true)
llvm::Expected< uint32_t > GetNumChildren(uint32_t max=UINT32_MAX)
virtual void GetExpressionPath(Stream &s, GetExpressionPathFormat=eGetExpressionPathFormatDereferencePointers)
bool UpdateFormatsIfNeeded()
virtual bool HasSyntheticValue()
lldb::StackFrameSP GetFrameSP() const
friend class ValueObjectChild
lldb::ValueObjectSP GetChildAtNamePath(llvm::ArrayRef< llvm::StringRef > names)
void SetSummaryFormat(lldb::TypeSummaryImplSP format)
virtual bool IsRuntimeSupportValue()
virtual ConstString GetTypeName()
DataExtractor & GetDataExtractor()
static lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type)
void SetValueDidChange(bool value_changed)
@ eClearUserVisibleDataItemsDescription
@ eClearUserVisibleDataItemsLocation
@ eClearUserVisibleDataItemsSummary
@ eClearUserVisibleDataItemsValue
@ eClearUserVisibleDataItemsSyntheticChildren
ValueObject * m_root
The root of the hierarchy for this ValueObject (or nullptr if never calculated).
bool GetValueIsValid() const
virtual lldb::ModuleSP GetModule()
Return the module associated with this value object in case the value is from an executable file and ...
virtual lldb::ValueObjectSP GetDynamicValue(lldb::DynamicValueType valueType)
void UpdateChildrenAddressType()
virtual lldb::ValueObjectSP AddressOf(Status &error)
lldb::DynamicValueType GetDynamicValueType()
lldb::LanguageType m_preferred_display_language
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr)
virtual llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max=UINT32_MAX)=0
Should only be called by ValueObject::GetNumChildren().
lldb::LanguageType GetObjectRuntimeLanguage()
virtual lldb::ValueObjectSP CreateConstantValue(ConstString name)
virtual lldb::addr_t GetAddressOf(bool scalar_is_load_address=true, AddressType *address_type=nullptr)
virtual bool IsLogicalTrue(Status &error)
lldb::Format m_last_format
virtual SymbolContextScope * GetSymbolContextScope()
virtual bool HasDynamicValueTypeInfo()
ValueObject * m_synthetic_value
void SetNumChildren(uint32_t num_children)
ValueObject * m_parent
The parent value object, or nullptr if this has no parent.
virtual bool IsBaseClass()
virtual bool GetDeclaration(Declaration &decl)
virtual lldb::ValueObjectSP Clone(ConstString new_name)
Creates a copy of the ValueObject with a new name and setting the current ValueObject as its parent.
lldb::ValueObjectSP GetQualifiedRepresentationIfAvailable(lldb::DynamicValueType dynValue, bool synthValue)
virtual ValueObject * CreateChildAtIndex(size_t idx, bool synthetic_array_member, int32_t synthetic_index)
Should only be called by ValueObject::GetChildAtIndex().
lldb::ValueObjectSP m_addr_of_valobj_sp
We have to hold onto a shared pointer to this one because it is created as an independent ValueObject...
std::pair< size_t, bool > ReadPointedString(lldb::WritableDataBufferSP &buffer_sp, Status &error, bool honor_array)
bool IsUninitializedReference()
bool UpdateValueIfNeeded(bool update_format=true)
AddressType GetAddressTypeOfChildren()
const Status & GetError()
lldb::TypeFormatImplSP m_type_format_sp
lldb::TargetSP GetTargetSP() const
ExpressionPathEndResultType
@ eExpressionPathEndResultTypeInvalid
@ eExpressionPathEndResultTypePlain
Anything but...
@ eExpressionPathEndResultTypeBoundedRange
A range [low-high].
@ eExpressionPathEndResultTypeBitfield
A bitfield.
@ eExpressionPathEndResultTypeUnboundedRange
A range [].
virtual lldb::ValueObjectSP Dereference(Status &error)
static lldb::ValueObjectSP CreateValueObjectFromAddress(llvm::StringRef name, uint64_t address, const ExecutionContext &exe_ctx, CompilerType type)
void SetPreferredDisplayLanguageIfNeeded(lldb::LanguageType)
virtual const char * GetValueAsCString()
bool HasSpecialPrintableRepresentation(ValueObjectRepresentationStyle val_obj_display, lldb::Format custom_format)
virtual const char * GetLocationAsCString()
ConstString GetName() const
std::string m_location_str
Cached location string that will get cleared if/when the value is updated.
lldb::ValueObjectSP GetVTable()
If this object represents a C++ class with a vtable, return an object that represents the virtual fun...
virtual bool SetValueFromCString(const char *value_str, Status &error)
virtual lldb::ValueObjectSP GetStaticValue()
lldb::ValueObjectSP Persist()
std::string m_object_desc_str
Cached result of the "object printer".
virtual ValueObject * GetParent()
virtual CompilerType MaybeCalculateCompleteType()
lldb::SyntheticChildrenSP m_synthetic_children_sp
const char * GetObjectDescription()
virtual uint32_t GetBitfieldBitOffset()
std::string m_old_value_str
Cached old value string from the last time the value was gotten.
lldb::ValueObjectSP GetSyntheticExpressionPathChild(const char *expression, bool can_create)
virtual bool SetData(DataExtractor &data, Status &error)
virtual int64_t GetValueAsSigned(int64_t fail_value, bool *success=nullptr)
const char * GetSummaryAsCString(lldb::LanguageType lang=lldb::eLanguageTypeUnknown)
ValueObjectRepresentationStyle
@ eValueObjectRepresentationStyleLocation
@ eValueObjectRepresentationStyleSummary
@ eValueObjectRepresentationStyleName
@ eValueObjectRepresentationStyleType
@ eValueObjectRepresentationStyleChildrenCount
@ eValueObjectRepresentationStyleExpressionPath
@ eValueObjectRepresentationStyleValue
@ eValueObjectRepresentationStyleLanguageSpecific
std::string m_value_str
Cached value string that will get cleared if/when the value is updated.
lldb::ValueObjectSP GetSyntheticArrayMember(size_t index, bool can_create)
virtual bool ResolveValue(Scalar &scalar)
void SetSyntheticChildren(const lldb::SyntheticChildrenSP &synth_sp)
ConstString m_name
The name of this object.
bool IsPointerOrReferenceType()
const char * GetLocationAsCStringImpl(const Value &value, const DataExtractor &data)
virtual void SetFormat(lldb::Format format)
ValueObject * m_dynamic_value
void ClearDynamicTypeInformation()
bool IsCStringContainer(bool check_pointer=false)
Returns true if this is a char* or a char[] if it is a char* and check_pointer is true,...
virtual bool IsSynthetic()
std::map< ConstString, ValueObject * > m_synthetic_children
const ExecutionContextRef & GetExecutionContextRef() const
uint32_t GetNumChildrenIgnoringErrors(uint32_t max=UINT32_MAX)
Like GetNumChildren but returns 0 on error.
virtual bool CanProvideValue()
const Value & GetValue() const
virtual lldb::LanguageType GetPreferredDisplayLanguage()
lldb::ValueObjectSP GetValueForExpressionPath_Impl(llvm::StringRef expression_cstr, ExpressionPathScanEndReason *reason_to_stop, ExpressionPathEndResultType *final_value_type, const GetValueForExpressionPathOptions &options, ExpressionPathAftermath *final_task_on_target)
const Scalar & GetScalar() const
Status GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data, Module *module)
RegisterInfo * GetRegisterInfo() const
ValueType
Type that describes Value::m_value.
@ HostAddress
A host address value (for memory in the process that < A is using liblldb).
@ FileAddress
A file address value.
@ LoadAddress
A load address value.
@ Scalar
A raw scalar value.
ValueType GetValueType() const
Scalar & ResolveValue(ExecutionContext *exe_ctx, Module *module=nullptr)
@ RegisterInfo
RegisterInfo * (can be a scalar or a vector register).
ContextType GetContextType() const
AddressType GetValueAddressType() const
const CompilerType & GetCompilerType()
uint8_t * GetBytes()
Get a pointer to the data.
#define LLDB_INVALID_ADDRESS
@ DoNoSelectMostRelevantFrame
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
@ eAddressTypeFile
Address is an address as found in an object or symbol file.
@ eAddressTypeLoad
Address is an address as in the current target inferior process.
@ eAddressTypeHost
Address is an address in the process that is running this code.
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::TypeSummaryImpl > TypeSummaryImplSP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::TypeFormatImpl > TypeFormatImplSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::ExpressionVariable > ExpressionVariableSP
Format
Display format definitions.
@ eFormatCString
NULL terminated C strings.
@ eFormatCharArray
Print characters with no single quotes, used for character arrays that can contain non printable char...
@ eFormatComplex
Floating point complex type.
@ eFormatOSType
OS character codes encoded into an integer 'PICT' 'text' etc...
@ eFormatCharPrintable
Only printable characters, '.' if not printable.
@ eFormatComplexInteger
Integer complex type.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
@ eLanguageTypeObjC
Objective-C.
std::shared_ptr< lldb_private::Type > TypeSP
std::shared_ptr< lldb_private::Process > ProcessSP
Encoding
Register encoding definitions.
@ eEncodingVector
vector registers
std::shared_ptr< lldb_private::SyntheticChildren > SyntheticChildrenSP
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::Module > ModuleSP
Every register is described in detail including its name, alternate name (optional),...
lldb::Encoding encoding
Encoding of the register bits.
const char * alt_name
Alternate name of this register, can be NULL.
const char * name
Name of this register, can't be NULL.
lldb::Format format
Default display format.
bool m_is_getting_summary
bool m_is_synthetic_children_generated
bool m_is_bitfield_for_scalar
bool m_is_array_item_for_pointer
bool m_did_calculate_complete_objc_class_type
bool m_children_count_valid
SyntheticChildrenTraversal m_synthetic_children_traversal
bool m_check_dot_vs_arrow_syntax
bool m_allow_bitfields_syntax
SyntheticChildrenTraversal