21#include "llvm/Support/ErrorExtras.h"
22#include "llvm/Support/FormatAdapters.h"
30 return type_system.get()->GetBasicTypeFromAST(basic_type);
37 llvm::StringRef name) {
51 return llvm::createStringErrorV(
"no compile unit for frame: {}",
56 return symbol_context.
module_sp->GetTypeSystemForLanguage(language);
59llvm::Expected<lldb::ValueObjectSP>
62 return llvm::make_error<DILDiagnosticError>(
m_expr,
"invalid value object",
64 llvm::Expected<lldb::TypeSystemSP> type_system =
67 return type_system.takeError();
70 if (valobj->IsBitfield()) {
75 uint32_t bitfield_size = valobj->GetBitfieldBitSize();
78 if (bitfield_size > 0 && in_type.
IsInteger()) {
82 llvm::Expected<uint64_t> int_bit_size =
85 return int_bit_size.takeError();
86 llvm::Expected<uint64_t> uint_bit_size =
89 return uint_bit_size.takeError();
90 if (bitfield_size < *int_bit_size ||
91 (in_type.
IsSigned() && bitfield_size == *int_bit_size))
92 return valobj->CastToBasicType(int_type);
93 if (bitfield_size <= *uint_bit_size)
94 return valobj->CastToBasicType(uint_type);
97 bool resolved = valobj->ResolveValue(scalar);
99 return llvm::createStringError(
"invalid scalar value");
109 valobj->GetCompilerType().GetPromotedIntegerType();
111 return valobj->CastToBasicType(promoted_type);
156 switch (basic_type) {
175llvm::Expected<CompilerType>
182 return lhs_size.takeError();
185 return rhs_size.takeError();
187 if (*rhs_size == *lhs_size) {
188 llvm::Expected<lldb::TypeSystemSP> type_system =
191 return type_system.takeError();
196 return r_type_unsigned;
202llvm::Expected<CompilerType>
208 return lhs_or_err.takeError();
212 return rhs_or_err.takeError();
228 if (l_rank == 0 || r_rank == 0)
229 return llvm::make_error<DILDiagnosticError>(
230 m_expr,
"unexpected basic type in arithmetic operation", location);
235 using Rank = std::tuple<size_t, bool>;
236 Rank int_l_rank = {l_rank, !lhs_type.
IsSigned()};
237 Rank int_r_rank = {r_rank, !rhs_type.
IsSigned()};
238 if (int_l_rank < int_r_rank) {
241 return type_or_err.takeError();
244 if (int_l_rank > int_r_rank) {
247 return type_or_err.takeError();
262 std::vector<lldb::VariableSP> possible_matches;
265 llvm::StringRef str_ref_name = var_sp->GetName().GetStringRef();
267 str_ref_name.consume_front(
"::");
273 if (var_sp->NameMatches(name))
274 possible_matches.push_back(var_sp);
278 if (possible_matches.size() > 0)
279 return possible_matches[0];
295 name_ref.consume_front(
"::");
310 target_sp->GetImages().FindGlobalVariables(
311 ConstString(name_ref), std::numeric_limits<uint32_t>::max(),
314 if (!modules_var_list.
Empty()) {
331 if (name_ref.consume_front(
"$")) {
336 if (
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName(name_ref))
342 if (!name_ref.contains(
"::")) {
351 variable_list->FindVariable(
ConstString(name_ref));
362 lldb::eSymbolContextFunction | lldb::eSymbolContextBlock);
366 value_sp = value_sp->GetChildMemberWithName(name_ref);
376 if (name_ref.contains(
"::")) {
377 llvm::StringRef enum_typename, enumerator_name;
380 std::tie(enum_typename, enumerator_name) = name_ref.rsplit(
"::");
385 const llvm::APSInt &value) ->
bool {
386 if (name == enumerator_name) {
389 enum_type,
"result");
405 const bool check_ptr_vs_member =
407 const bool no_synth_child =
409 const bool allow_var_updates =
411 const bool disallow_globals =
422 auto value_or_error = node.
Accept(
this);
424 if (value_or_error && !*value_or_error)
425 return llvm::make_error<DILDiagnosticError>(
m_expr,
"invalid value object",
429 return value_or_error;
432llvm::Expected<lldb::ValueObjectSP>
434 auto valobj_or_err =
Evaluate(node);
436 return valobj_or_err;
440 if (valobj->GetCompilerType().IsReferenceType()) {
441 valobj = valobj->Dereference(
error);
443 return error.ToError();
448llvm::Expected<lldb::ValueObjectSP>
462 if (!identifier && node.
GetName() ==
"nullptr") {
465 llvm::Expected<lldb::TypeSystemSP> type_system =
468 return type_system.takeError();
469 type_system.get()->GetPointerByteSize();
470 llvm::APInt value(type_system.get()->GetPointerByteSize() * CHAR_BIT, 0);
479 llvm::formatv(
"use of undeclared identifier '{0}'", node.
GetName());
480 return llvm::make_error<DILDiagnosticError>(
487llvm::Expected<lldb::ValueObjectSP>
500 operand = dynamic_op;
506 child_sp = synth_obj_sp->Dereference(
error);
510 return llvm::make_error<DILDiagnosticError>(
m_expr,
error.AsCString(),
519 return llvm::make_error<DILDiagnosticError>(
m_expr,
error.AsCString(),
525 if (operand->GetCompilerType().IsReferenceType()) {
526 operand = operand->Dereference(
error);
528 return error.ToError();
530 llvm::Expected<lldb::ValueObjectSP> conv_op =
538 llvm::formatv(
"invalid argument type '{0}' to unary expression",
540 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg,
544 bool resolved = operand->ResolveValue(scalar);
551 m_stack_frame, scalar, operand->GetCompilerType(),
"result");
555 if (operand->GetCompilerType().IsReferenceType()) {
556 operand = operand->Dereference(
error);
558 return error.ToError();
560 llvm::Expected<lldb::ValueObjectSP> conv_op =
570 llvm::formatv(
"invalid argument type '{0}' to unary expression",
572 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg,
578 if (operand->GetCompilerType().IsReferenceType()) {
579 operand = operand->Dereference(
error);
581 return error.ToError();
583 llvm::Expected<lldb::ValueObjectSP> conv_op =
591 llvm::formatv(
"invalid argument type '{0}' to unary expression",
593 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg,
597 bool resolved = operand->ResolveValue(scalar);
599 std::string errMsg = llvm::formatv(
"invalid operand value: {0}",
600 operand->GetError().AsCString());
601 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg,
608 m_stack_frame, scalar, operand->GetCompilerType(),
"result");
612 if (operand->GetCompilerType().IsReferenceType()) {
613 operand = operand->Dereference(
error);
615 return error.ToError();
620 llvm::formatv(
"invalid argument type '{0}' to unary expression",
622 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg,
625 llvm::Expected<lldb::TypeSystemSP> type_system =
628 return type_system.takeError();
629 auto value_or_err = operand->GetValueAsBool();
631 return value_or_err.takeError();
633 !(*value_or_err),
"result");
636 return llvm::make_error<DILDiagnosticError>(
m_expr,
"invalid unary operation",
640llvm::Expected<lldb::ValueObjectSP>
644 if (ptr->GetCompilerType().IsPointerToVoid())
645 return llvm::make_error<DILDiagnosticError>(
646 m_expr,
"arithmetic on a pointer to void", location);
647 if (ptr->GetValueAsUnsigned(0) == 0 && offset != 0)
648 return llvm::make_error<DILDiagnosticError>(
649 m_expr,
"arithmetic on a nullptr is undefined", location);
652 int64_t offset_int = offset->GetValueAsSigned(0, &success);
654 std::string errMsg = llvm::formatv(
"could not get the offset: {0}",
655 offset->GetError().AsCString());
656 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(errMsg),
660 llvm::Expected<uint64_t> byte_size =
661 ptr->GetCompilerType().GetPointeeType().GetByteSize(&
m_stack_frame);
663 return byte_size.takeError();
664 uint64_t ptr_addr = ptr->GetValueAsUnsigned(0);
666 ptr_addr -= offset_int * (*byte_size);
668 ptr_addr += offset_int * (*byte_size);
676llvm::Expected<lldb::ValueObjectSP>
681 bool l_resolved = lhs->ResolveValue(
l);
684 llvm::formatv(
"invalid lhs value: {0}", lhs->GetError().AsCString());
685 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg, location);
687 bool r_resolved = rhs->ResolveValue(r);
690 llvm::formatv(
"invalid rhs value: {0}", rhs->GetError().AsCString());
691 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg, location);
694 auto value_object = [
this, result_type](
Scalar scalar) {
696 result_type,
"result");
701 return value_object(
l + r);
703 return value_object(
l - r);
705 return value_object(
l * r);
707 return value_object(
l / r);
709 return value_object(
l % r);
711 return value_object(
l & r);
713 return value_object(
l ^ r);
715 return value_object(
l | r);
717 return value_object(
l << r);
719 return value_object(
l >> r);
721 return value_object(
l < r);
723 return value_object(
l > r);
725 return value_object(
l <= r);
727 return value_object(
l >= r);
729 return value_object(
l == r);
731 return value_object(
l != r);
735 return llvm::make_error<DILDiagnosticError>(
736 m_expr,
"invalid arithmetic operation", location);
745 auto orig_lhs_type = lhs->GetCompilerType();
746 auto orig_rhs_type = rhs->GetCompilerType();
749 return type_or_err.takeError();
758 if (lhs->GetCompilerType().IsPointerType()) {
761 }
else if (rhs->GetCompilerType().IsPointerType()) {
766 if (!ptr || !offset->GetCompilerType().IsInteger()) {
768 llvm::formatv(
"invalid operands to binary expression ('{0}' and '{1}')",
769 orig_lhs_type.GetTypeName(), orig_rhs_type.GetTypeName());
770 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(errMsg),
783 auto orig_lhs_type = lhs->GetCompilerType();
784 auto orig_rhs_type = rhs->GetCompilerType();
787 return type_or_err.takeError();
793 auto lhs_type = lhs->GetCompilerType();
794 auto rhs_type = rhs->GetCompilerType();
797 if (lhs_type.IsPointerType() && rhs_type.IsInteger())
801 if (lhs_type.IsPointerType() && rhs_type.IsPointerType()) {
802 if (lhs_type.IsPointerToVoid() && rhs_type.IsPointerToVoid()) {
803 return llvm::make_error<DILDiagnosticError>(
804 m_expr,
"arithmetic on pointers to void", location);
809 if (!lhs_unqualified_type.
CompareTypes(rhs_unqualified_type)) {
810 std::string errMsg = llvm::formatv(
811 "'{0}' and '{1}' are not pointers to compatible types",
812 orig_lhs_type.GetTypeName(), orig_rhs_type.GetTypeName());
813 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg, location);
816 llvm::Expected<uint64_t> lhs_byte_size =
819 return lhs_byte_size.takeError();
821 int64_t item_size = *lhs_byte_size;
822 int64_t diff =
static_cast<int64_t
>(lhs->GetValueAsUnsigned(0) -
823 rhs->GetValueAsUnsigned(0));
824 assert(item_size > 0 &&
"Pointee size cannot be 0");
825 if (diff % item_size != 0) {
828 return llvm::make_error<DILDiagnosticError>(
829 m_expr,
"undefined pointer arithmetic", location);
833 llvm::Expected<lldb::TypeSystemSP> type_system =
836 return type_system.takeError();
837 CompilerType ptrdiff_type = type_system.get()->GetPointerDiffType(
true);
839 return llvm::make_error<DILDiagnosticError>(
840 m_expr,
"unable to determine pointer diff type", location);
844 ptrdiff_type,
"result");
848 llvm::formatv(
"invalid operands to binary expression ('{0}' and '{1}')",
849 orig_lhs_type.GetTypeName(), orig_rhs_type.GetTypeName());
850 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(errMsg),
858 auto orig_lhs_type = lhs->GetCompilerType();
859 auto orig_rhs_type = rhs->GetCompilerType();
862 return type_or_err.takeError();
867 llvm::formatv(
"invalid operands to binary expression ('{0}' and '{1}')",
868 orig_lhs_type.GetTypeName(), orig_rhs_type.GetTypeName());
869 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(errMsg),
880 auto orig_lhs_type = lhs->GetCompilerType();
881 auto orig_rhs_type = rhs->GetCompilerType();
884 return type_or_err.takeError();
889 llvm::formatv(
"invalid operands to binary expression ('{0}' and '{1}')",
890 orig_lhs_type.GetTypeName(), orig_rhs_type.GetTypeName());
891 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(errMsg),
896 if (result_type.
IsInteger() && rhs->GetValueAsSigned(-1) == 0) {
897 return llvm::make_error<DILDiagnosticError>(
898 m_expr,
"division by zero is undefined", location);
908 auto orig_lhs_type = lhs->GetCompilerType();
909 auto orig_rhs_type = rhs->GetCompilerType();
912 return type_or_err.takeError();
917 llvm::formatv(
"invalid operands to binary expression ('{0}' and '{1}')",
918 orig_lhs_type.GetTypeName(), orig_rhs_type.GetTypeName());
919 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(errMsg),
923 if (rhs->GetValueAsSigned(-1) == 0) {
924 return llvm::make_error<DILDiagnosticError>(
925 m_expr,
"division by zero is undefined", location);
941 return llvm::createStringError(
942 "Illegal type for lhs of assignment (not scalar numeric type)");
947 return llvm::createStringError(
948 "Illegal type for rhs of assignment (not scalar numeric type)");
953 return llvm::createStringError(
954 "Invalid assignment: Can only assign pointers to pointers");
959 lhs_type != rhs_type) {
960 std::string err_msg =
961 llvm::formatv(
"Incompatible types for assignment: Cannot assign {0} "
964 return llvm::createStringError(err_msg);
970llvm::Expected<lldb::ValueObjectSP>
977 return all_ok.takeError();
986 bool is_zero = val->GetValueAsUnsigned(-1) == 0;
987 bool is_boolean = val->GetCompilerType().IsBoolean();
988 return is_zero && !is_boolean && is_literal;
994 bool rhs_is_literal, uint32_t location) {
995 auto orig_lhs_type = lhs->GetCompilerType();
996 auto orig_rhs_type = rhs->GetCompilerType();
1000 bool lhs_nullptr_or_zero =
1001 orig_lhs_type.IsNullPtrType() ||
IsLiteralZero(lhs, lhs_is_literal);
1002 bool rhs_nullptr_or_zero =
1003 orig_rhs_type.IsNullPtrType() ||
IsLiteralZero(rhs, rhs_is_literal);
1005 if (orig_lhs_type.IsArrayType())
1007 if (orig_rhs_type.IsArrayType())
1013 if (lhs_type == rhs_type)
1014 return llvm::Error::success();
1024 lhs_child = lhs->GetChildAtIndex(0);
1025 if (lhs_child && (lhs_child->IsPointerType() ||
1026 lhs_child->GetCompilerType().IsNullPtrType()))
1027 lhs_type = lhs_child->GetCompilerType();
1033 rhs_child = rhs->GetChildAtIndex(0);
1034 if (rhs_child && (rhs_child->IsPointerType() ||
1035 rhs_child->GetCompilerType().IsNullPtrType()))
1036 rhs_type = rhs_child->GetCompilerType();
1039 if ((lhs_type != orig_lhs_type) || (rhs_type != orig_rhs_type)) {
1041 return llvm::Error::success();
1045 return llvm::Error::success();
1053 return llvm::Error::success();
1057 bool comparable = lhs_unqualified.
CompareTypes(rhs_unqualified);
1059 return llvm::Error::success();
1061 std::string errMsg = llvm::formatv(
1062 "comparison of distinct pointer types ({0} and {1})",
1063 orig_lhs_type.TypeDescription(), orig_rhs_type.TypeDescription());
1064 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg, location);
1067 if (!is_ordered && ((orig_lhs_type.IsNullPtrType() && rhs_nullptr_or_zero) ||
1068 (lhs_nullptr_or_zero && orig_rhs_type.IsNullPtrType())))
1069 return llvm::Error::success();
1076 return type_or_err.takeError();
1078 lhs_type = lhs->GetCompilerType();
1079 rhs_type = rhs->GetCompilerType();
1082 return llvm::Error::success();
1088 return llvm::Error::success();
1089 std::string errMsg = llvm::formatv(
1090 "invalid operands to binary expression ({0} and {1})",
1091 orig_lhs_type.TypeDescription(), orig_rhs_type.TypeDescription());
1092 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg, location);
1101 return t.IsPointerType() || t.IsInteger() ||
1102 t.IsUnscopedEnumerationType() || (!is_ordered && t.IsNullPtrType());
1105 if ((lhs_type.
IsPointerType() && comparable_to_pointer(rhs_type)) ||
1106 (comparable_to_pointer(lhs_type) && rhs_type.
IsPointerType())) {
1115 bool comparable = lhs_unqualified_type.
CompareTypes(rhs_unqualified_type);
1119 std::string errMsg = llvm::formatv(
1120 "comparison of distinct pointer types ({0} and {1})",
1121 orig_lhs_type.TypeDescription(), orig_rhs_type.TypeDescription());
1122 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg, location);
1126 return llvm::Error::success();
1129 std::string errMsg = llvm::formatv(
1130 "invalid operands to binary expression ({0} and {1})",
1131 orig_lhs_type.TypeDescription(), orig_rhs_type.TypeDescription());
1132 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg, location);
1135llvm::Expected<lldb::ValueObjectSP>
1138 bool rhs_is_literal, uint32_t location) {
1148 rhs_is_literal, location))
1151 llvm::Expected<lldb::TypeSystemSP> type_system =
1154 return type_system.takeError();
1160llvm::Expected<lldb::ValueObjectSP>
1165 auto orig_lhs_type = lhs->GetCompilerType();
1166 auto orig_rhs_type = rhs->GetCompilerType();
1169 return type_or_err.takeError();
1173 std::string errMsg =
1174 llvm::formatv(
"invalid operands to binary expression ('{0}' and '{1}')",
1175 orig_lhs_type.GetTypeName(), orig_rhs_type.GetTypeName());
1176 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg, location);
1182llvm::Expected<lldb::ValueObjectSP>
1191 return lhs_or_err.takeError();
1195 return rhs_or_err.takeError();
1201 std::string errMsg =
1202 llvm::formatv(
"invalid operands to binary expression ('{0}' and '{1}')",
1204 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg, location);
1208 uint64_t amount = rhs->GetValueAsUnsigned(0, &success);
1210 return llvm::make_error<DILDiagnosticError>(
1211 m_expr,
"could not get the shift amount as an integer", location);
1214 return lhs_size.takeError();
1215 if (amount >= *lhs_size)
1216 return llvm::make_error<DILDiagnosticError>(
m_expr,
"invalid shift amount",
1222llvm::Expected<lldb::ValueObjectSP>
1232 auto lhs_type = lhs->GetCompilerType();
1233 if (!lhs_type.IsContextuallyConvertibleToBool()) {
1234 std::string errMsg = llvm::formatv(
1235 "value of type {0} is not contextually convertible to 'bool'",
1236 lhs_type.TypeDescription());
1237 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg,
1240 llvm::Expected<lldb::TypeSystemSP> type_system =
1243 return type_system.takeError();
1247 auto lvalue_or_err = lhs->GetValueAsBool();
1249 return lvalue_or_err.takeError();
1250 bool lhs_val = *lvalue_or_err;
1261 auto rhs_type = rhs->GetCompilerType();
1262 if (!rhs_type.IsContextuallyConvertibleToBool()) {
1263 std::string errMsg = llvm::formatv(
1264 "value of type {0} is not contextually convertible to 'bool'",
1265 rhs_type.TypeDescription());
1266 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg,
1270 auto rvalue_or_err = rhs->GetValueAsBool();
1272 return rvalue_or_err.takeError();
1274 *rvalue_or_err,
"result");
1277llvm::Expected<lldb::ValueObjectSP>
1296 lhs->GetCompilerType().GetTypeSystem().GetSharedPointer();
1298 rhs->GetCompilerType().GetTypeSystem().GetSharedPointer();
1299 if (lhs_system->GetPluginName() != rhs_system->GetPluginName()) {
1301 return llvm::make_error<DILDiagnosticError>(
1349 return llvm::make_error<DILDiagnosticError>(
1353llvm::Expected<lldb::ValueObjectSP>
1365 if (!base->IsPointerType() && base->HasSyntheticValue()) {
1368 base->GetSyntheticValue()->Dereference(deref_error);
1369 synth_deref_sp && deref_error.
Success()) {
1370 base = std::move(synth_deref_sp);
1372 if (!base || deref_error.
Fail()) {
1373 std::string errMsg = llvm::formatv(
1374 "Failed to dereference synthetic value: {0}", deref_error);
1375 return llvm::make_error<DILDiagnosticError>(
1381 std::string errMsg =
"Failed to dereference synthetic value";
1382 return llvm::make_error<DILDiagnosticError>(
1385 expr_is_ptr =
false;
1390 bool base_is_ptr = base->IsPointerType();
1392 if (expr_is_ptr != base_is_ptr) {
1394 std::string errMsg =
1395 llvm::formatv(
"member reference type {0} is a pointer; "
1396 "did you mean to use '->'?",
1397 base->GetCompilerType().TypeDescription());
1398 return llvm::make_error<DILDiagnosticError>(
1401 std::string errMsg =
1402 llvm::formatv(
"member reference type {0} is not a pointer; "
1403 "did you mean to use '.'?",
1404 base->GetCompilerType().TypeDescription());
1405 return llvm::make_error<DILDiagnosticError>(
1415 field_obj = base->GetSyntheticValue();
1417 field_obj = field_obj->GetChildMemberWithName(node.
GetFieldName());
1421 std::string errMsg = llvm::formatv(
1422 "\"{0}\" is not a member of \"({1}) {2}\"", node.
GetFieldName(),
1423 base->GetTypeName().AsCString(
"<invalid type>"), base->GetName());
1424 return llvm::make_error<DILDiagnosticError>(
1434 field_obj = dynamic_val_sp;
1440 if (node.
GetIsArrow() && base->IsPointerType())
1442 std::string errMsg = llvm::formatv(
1443 "\"{0}\" is not a member of \"({1}) {2}\"", node.
GetFieldName(),
1444 base->GetTypeName().AsCString(
"<invalid type>"), base->GetName());
1445 return llvm::make_error<DILDiagnosticError>(
1449llvm::Expected<lldb::ValueObjectSP>
1456 if (!idx->GetCompilerType().IsIntegerOrUnscopedEnumerationType()) {
1457 return llvm::make_error<DILDiagnosticError>(
1462 uint64_t child_idx = idx->GetValueAsUnsigned(0);
1470 CompilerType base_type = base->GetCompilerType().GetNonReferenceType();
1471 base->GetExpressionPath(var_expr_path_strm);
1472 bool is_incomplete_array =
false;
1474 bool is_objc_pointer =
true;
1477 is_objc_pointer =
false;
1478 else if (!base->GetCompilerType().IsPointerType())
1479 is_objc_pointer =
false;
1482 std::string err_msg = llvm::formatv(
1483 "\"({0}) {1}\" is an Objective-C pointer, and cannot be subscripted",
1484 base->GetTypeName().AsCString(
"<invalid type>"),
1485 var_expr_path_strm.
GetData());
1486 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(err_msg),
1489 if (is_objc_pointer) {
1491 if (!synthetic || synthetic == base) {
1492 std::string err_msg =
1493 llvm::formatv(
"\"({0}) {1}\" is not an array type",
1494 base->GetTypeName().AsCString(
"<invalid type>"),
1495 var_expr_path_strm.
GetData());
1496 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(err_msg),
1499 if (
static_cast<uint32_t
>(child_idx) >=
1500 synthetic->GetNumChildrenIgnoringErrors()) {
1501 std::string err_msg = llvm::formatv(
1502 "array index {0} is not valid for \"({1}) {2}\"", child_idx,
1503 base->GetTypeName().AsCString(
"<invalid type>"),
1504 var_expr_path_strm.
GetData());
1505 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(err_msg),
1508 child_valobj_sp = synthetic->GetChildAtIndex(child_idx);
1509 if (!child_valobj_sp) {
1510 std::string err_msg = llvm::formatv(
1511 "array index {0} is not valid for \"({1}) {2}\"", child_idx,
1512 base->GetTypeName().AsCString(
"<invalid type>"),
1513 var_expr_path_strm.
GetData());
1514 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(err_msg),
1518 if (
auto dynamic_sp = child_valobj_sp->GetDynamicValue(
m_use_dynamic))
1519 child_valobj_sp = std::move(dynamic_sp);
1521 return child_valobj_sp;
1524 child_valobj_sp = base->GetSyntheticArrayMember(child_idx,
true);
1525 if (!child_valobj_sp) {
1526 std::string err_msg = llvm::formatv(
1527 "failed to use pointer as array for index {0} for "
1529 child_idx, base->GetTypeName().AsCString(
"<invalid type>"),
1530 var_expr_path_strm.
GetData());
1532 err_msg =
"subscript of pointer to incomplete type 'void'";
1533 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(err_msg),
1536 }
else if (base_type.
IsArrayType(
nullptr,
nullptr, &is_incomplete_array)) {
1537 child_valobj_sp = base->GetChildAtIndex(child_idx);
1539 child_valobj_sp = base->GetSyntheticArrayMember(child_idx,
true);
1540 if (!child_valobj_sp) {
1541 std::string err_msg = llvm::formatv(
1542 "array index {0} is not valid for \"({1}) {2}\"", child_idx,
1543 base->GetTypeName().AsCString(
"<invalid type>"),
1544 var_expr_path_strm.
GetData());
1545 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(err_msg),
1550 base->GetSyntheticBitFieldChild(child_idx, child_idx,
true);
1551 if (!child_valobj_sp) {
1552 std::string err_msg = llvm::formatv(
1553 "bitfield range {0}:{1} is not valid for \"({2}) {3}\"", child_idx,
1554 child_idx, base->GetTypeName().AsCString(
"<invalid type>"),
1555 var_expr_path_strm.
GetData());
1556 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(err_msg),
1562 std::string err_msg =
1563 llvm::formatv(
"\"{0}\" is not an array type",
1564 base->GetTypeName().AsCString(
"<invalid type>"));
1565 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(err_msg),
1568 if (
static_cast<uint32_t
>(child_idx) >=
1569 synthetic->GetNumChildrenIgnoringErrors(child_idx + 1)) {
1570 std::string err_msg = llvm::formatv(
1571 "array index {0} is not valid for \"({1}) {2}\"", child_idx,
1572 base->GetTypeName().AsCString(
"<invalid type>"),
1573 var_expr_path_strm.
GetData());
1574 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(err_msg),
1577 child_valobj_sp = synthetic->GetChildAtIndex(child_idx);
1578 if (!child_valobj_sp) {
1579 std::string err_msg = llvm::formatv(
1580 "array index {0} is not valid for \"({1}) {2}\"", child_idx,
1581 base->GetTypeName().AsCString(
"<invalid type>"),
1582 var_expr_path_strm.
GetData());
1583 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(err_msg),
1588 if (child_valobj_sp) {
1590 if (
auto dynamic_sp = child_valobj_sp->GetDynamicValue(
m_use_dynamic))
1591 child_valobj_sp = std::move(dynamic_sp);
1593 return child_valobj_sp;
1597 int64_t signed_child_idx = idx->GetValueAsSigned(0, &success);
1599 return llvm::make_error<DILDiagnosticError>(
1600 m_expr,
"could not get the index as an integer",
1602 return base->GetSyntheticArrayMember(signed_child_idx,
true);
1605llvm::Expected<lldb::ValueObjectSP>
1608 if (!first_idx_or_err)
1609 return first_idx_or_err;
1612 if (!last_idx_or_err)
1613 return last_idx_or_err;
1616 if (!first_idx->GetCompilerType().IsIntegerOrUnscopedEnumerationType() ||
1617 !last_idx->GetCompilerType().IsIntegerOrUnscopedEnumerationType()) {
1618 return llvm::make_error<DILDiagnosticError>(
1622 bool success_first, success_last;
1623 int64_t first_index = first_idx->GetValueAsSigned(0, &success_first);
1624 int64_t last_index = last_idx->GetValueAsSigned(0, &success_last);
1625 if (!success_first || !success_last)
1626 return llvm::make_error<DILDiagnosticError>(
1632 if (first_index < 0 || last_index < 0) {
1633 std::string message =
1634 llvm::formatv(
"bitfield range {0}:{1} is not valid (negative index)",
1635 first_index, last_index);
1636 return llvm::make_error<DILDiagnosticError>(
m_expr, message,
1641 if (first_index > last_index)
1642 std::swap(first_index, last_index);
1647 if (last_index - first_index >= 64) {
1648 std::string message =
1649 llvm::formatv(
"bitfield range {0}:{1} is not valid (more than 64 bits)",
1650 first_index, last_index);
1651 return llvm::make_error<DILDiagnosticError>(
m_expr, message,
1663 llvm::Expected<uint64_t> base_bit_size =
1666 return base_bit_size.takeError();
1667 if (
static_cast<uint64_t
>(last_index) >= *base_bit_size) {
1668 std::string message = llvm::formatv(
1669 "bitfield range {0}:{1} is not valid for \"({2}) {3}\"", first_index,
1670 last_index, base->GetTypeName().AsCString(
"<invalid type>"),
1671 base->GetName().GetStringRef());
1672 return llvm::make_error<DILDiagnosticError>(
m_expr, message,
1677 base->GetSyntheticBitFieldChild(first_index, last_index,
true);
1678 if (!child_valobj_sp) {
1679 std::string message = llvm::formatv(
1680 "bitfield range {0}:{1} is not valid for \"({2}) {3}\"", first_index,
1681 last_index, base->GetTypeName().AsCString(
"<invalid type>"),
1682 base->GetName().GetStringRef());
1683 return llvm::make_error<DILDiagnosticError>(
m_expr, message,
1686 return child_valobj_sp;
1689llvm::Expected<CompilerType>
1696 llvm::APInt apint = literal.
GetValue();
1698 llvm::SmallVector<std::pair<lldb::BasicType, lldb::BasicType>, 3> candidates;
1709 for (
auto [signed_, unsigned_] : candidates) {
1710 CompilerType signed_type = type_system->GetBasicTypeFromAST(signed_);
1713 llvm::Expected<uint64_t> size = signed_type.
GetBitSize(&ctx);
1715 return size.takeError();
1716 if (!literal.
IsUnsigned() && apint.isIntN(*size - 1))
1719 return type_system->GetBasicTypeFromAST(unsigned_);
1722 return llvm::make_error<DILDiagnosticError>(
1724 "integer literal is too large to be represented in any integer type",
1728llvm::Expected<lldb::ValueObjectSP>
1730 llvm::Expected<lldb::TypeSystemSP> type_system =
1733 return type_system.takeError();
1735 llvm::Expected<CompilerType> type =
1738 return type.takeError();
1743 llvm::Expected<uint64_t> type_bitsize = type->GetBitSize(&
m_stack_frame);
1745 return type_bitsize.takeError();
1749 if (type->IsSigned())
1755llvm::Expected<lldb::ValueObjectSP>
1757 llvm::Expected<lldb::TypeSystemSP> type_system =
1760 return type_system.takeError();
1763 &node.
GetValue().getSemantics() == &llvm::APFloat::IEEEsingle();
1769 return llvm::make_error<DILDiagnosticError>(
1777llvm::Expected<lldb::ValueObjectSP>
1780 llvm::Expected<lldb::TypeSystemSP> type_system =
1783 return type_system.takeError();
1788llvm::Expected<CastKind>
1793 if (target_type.
GetTypeInfo() & lldb::eTypeIsFloat) {
1794 std::string errMsg = llvm::formatv(
"Cast from {0} to {1} is not allowed",
1797 return llvm::make_error<DILDiagnosticError>(
1798 m_expr, std::move(errMsg), location,
1808 uint64_t type_byte_size = 0;
1809 uint64_t rhs_type_byte_size = 0;
1811 type_byte_size = *temp;
1813 std::string errMsg = llvm::formatv(
"unable to get byte size for type {0}",
1816 "GetByteSize failed: {0}");
1817 return llvm::make_error<DILDiagnosticError>(
1818 m_expr, std::move(errMsg), location,
1823 rhs_type_byte_size = *temp;
1825 std::string errMsg = llvm::formatv(
"unable to get byte size for type {0}",
1828 "GetByteSize failed: {0}");
1829 return llvm::make_error<DILDiagnosticError>(
1830 m_expr, std::move(errMsg), location,
1834 if (type_byte_size < rhs_type_byte_size) {
1835 std::string errMsg = llvm::formatv(
1836 "cast from pointer to smaller type {0} loses information",
1838 return llvm::make_error<DILDiagnosticError>(
1839 m_expr, std::move(errMsg), location,
1844 std::string errMsg = llvm::formatv(
"cannot convert {0} to {1}",
1848 return llvm::make_error<DILDiagnosticError>(
1849 m_expr, std::move(errMsg), location,
1855llvm::Expected<CastKind>
1866 std::string errMsg = llvm::formatv(
"Cast from {0} to {1} is not allowed",
1870 return llvm::make_error<DILDiagnosticError>(
1871 m_expr, std::move(errMsg), location,
1881 std::string errMsg = llvm::formatv(
1882 "cannot cast from type {0} to pointer type {1}",
1885 return llvm::make_error<DILDiagnosticError>(
1886 m_expr, std::move(errMsg), location,
1893 std::string errMsg = llvm::formatv(
1894 "casting of {0} to {1} is not implemented yet",
1896 return llvm::make_error<DILDiagnosticError>(
1897 m_expr, std::move(errMsg), location,
1904 if (!operand_or_err)
1905 return operand_or_err;
1915 operand->GetName().GetStringRef());
1916 op_type = operand->GetCompilerType();
1921 return type_or_err.takeError();
1924 if (operand->GetCompilerType().IsReferenceType()) {
1926 operand = operand->Dereference(
error);
1928 return llvm::make_error<DILDiagnosticError>(
m_expr,
error.AsCString(),
1932 switch (cast_kind) {
1937 return operand->CastToEnumType(target_type);
1943 return operand->CastToBasicType(target_type);
1948 ? operand->GetLoadAddress()
1949 : (op_type.
IsSigned() ? operand->GetValueAsSigned(0)
1950 : operand->GetValueAsUnsigned(0));
1951 llvm::StringRef name =
"result";
1962 std::string errMsg =
1963 llvm::formatv(
"unable to cast from '{0}' to '{1}'",
1965 return llvm::make_error<DILDiagnosticError>(
m_expr, std::move(errMsg),
1969llvm::Expected<lldb::ValueObjectSP>
1978 std::string errMsg = llvm::formatv(
1979 "value of type {0} is not contextually convertible to 'bool'",
1981 return llvm::make_error<DILDiagnosticError>(
m_expr, errMsg,
1986 auto value_or_err = condition->GetValueAsBool();
1988 if (*value_or_err) {
1992 return *true_or_err;
1996 return false_or_err;
1997 return *false_or_err;
1999 return value_or_err.takeError();
2010 return byte_size.takeError();
2018 if (arg->IsBitfield())
2019 return llvm::make_error<DILDiagnosticError>(
2020 m_expr,
"invalid application of 'sizeof' to bit-field",
2023 llvm::Expected<uint64_t> byte_size = arg->GetByteSize();
2025 return byte_size.takeError();
2029 llvm::Expected<lldb::TypeSystemSP> type_system =
2032 return type_system.takeError();
2033 CompilerType size_type = type_system.get()->GetSizeType();
2035 return llvm::make_error<DILDiagnosticError>(
2039 size_type,
"result");
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG_ERROR(log, error,...)
lldb::VariableListSP GetVariableList(bool can_create)
Get the variable list for a compile unit.
lldb::LanguageType GetLanguage()
Generic representation of a type in a programming language.
bool IsEnumerationType(bool &is_signed) const
lldb::BasicType GetBasicTypeEnumeration() const
bool IsArrayType(CompilerType *element_type=nullptr, uint64_t *size=nullptr, bool *is_incomplete=nullptr) const
bool IsScalarOrUnscopedEnumerationType() const
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
bool IsContextuallyConvertibleToBool() const
This may only be defined in TypeSystemClang.
llvm::Expected< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
bool IsPointerToVoid() const
void ForEachEnumerator(std::function< bool(const CompilerType &integer_type, ConstString name, const llvm::APSInt &value)> const &callback) const
If this type is an enumeration, iterate through all of its enumerators using a callback.
bool IsIntegerOrEnumerationType(bool &is_signed) const
bool IsScopedEnumerationType() const
CompilerType GetNonReferenceType() const
If this type is a reference to a type (L value or R value reference), return a new type with the refe...
ConstString GetTypeName(bool BaseOnly=false) const
bool IsReferenceType(CompilerType *pointee_type=nullptr, bool *is_rvalue=nullptr) const
std::string TypeDescription()
CompilerType GetArrayElementType(ExecutionContextScope *exe_scope) const
Creating related types.
bool IsInteger() const
This is used when you don't care about the signedness of the integer.
CompilerType GetFullyUnqualifiedType() const
CompilerType GetPointeeType() const
If this type is a pointer type, return the type that the pointer points to, else return an invalid ty...
bool IsUnscopedEnumerationType() const
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
bool CompareTypes(CompilerType rhs) const
llvm::Expected< uint64_t > GetBitSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bits.
bool IsScalarType() const
bool IsNullPtrType() const
CompilerType GetCanonicalType() const
bool IsPointerType(CompilerType *pointee_type=nullptr) const
A uniqued constant string class.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
virtual void CalculateExecutionContext(ExecutionContext &exe_ctx)=0
Reconstruct the object's execution context into sc.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void TruncOrExtendTo(uint16_t bits, bool sign)
Convert to an integer with bits and the given signedness.
This base class provides an interface to stack frames.
@ eExpressionPathOptionCheckPtrVsMember
@ eExpressionPathOptionsDisallowGlobals
@ eExpressionPathOptionsAllowVarUpdates
@ eExpressionPathOptionsNoSyntheticChildren
virtual const char * GetFunctionName()
Get the frame's demangled name.
virtual lldb::RegisterContextSP GetRegisterContext()
Get the RegisterContext for this frame, if possible.
virtual lldb::ValueObjectSP GetValueObjectForFrameVariable(const lldb::VariableSP &variable_sp, lldb::DynamicValueType use_dynamic)
Create a ValueObject for a given Variable in this StackFrame.
virtual const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
virtual lldb::VariableListSP GetInScopeVariableList(bool get_file_globals, bool include_synthetic_vars=true, bool must_have_valid_location=false)
Retrieve the list of variables that are in scope at this StackFrame's pc.
virtual lldb::ValueObjectSP FindVariable(ConstString name)
Attempt to reconstruct the ValueObject for a variable with a given name from within the current Stack...
bool Fail() const
Test for error condition.
bool Success() const
Test for success condition.
const char * GetData() const
Defines a symbol context baton that can be handed other debug core functions.
llvm::StringRef GetInstanceName()
Determines the name of the instance for this decl context.
lldb::ModuleSP module_sp
The Module for a given query.
CompileUnit * comp_unit
The CompileUnit for a given query.
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::RegisterContextSP ®_ctx_sp, const RegisterInfo *reg_info)
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp)
static lldb::ValueObjectSP CreateValueObjectFromScalar(const ExecutionContext &exe_ctx, Scalar &s, CompilerType type, llvm::StringRef name, ValueObject *parent=nullptr)
Create a value object containing the given Scalar value.
static lldb::ValueObjectSP CreateValueObjectFromBool(const ExecutionContext &exe_ctx, lldb::TypeSystemSP typesystem, bool value, llvm::StringRef name, ValueObject *parent=nullptr)
Create a value object containing the given boolean value.
lldb::addr_t GetLoadAddress()
Return the target load address associated with this value object.
CompilerType GetCompilerType()
static lldb::ValueObjectSP CreateValueObjectFromAddress(llvm::StringRef name, uint64_t address, const ExecutionContext &exe_ctx, CompilerType type, bool do_deref=true, ValueObject *parent=nullptr)
Given an address either create a value object containing the value at that address,...
The rest of the classes in this file, except for the Visitor class at the very end,...
uint32_t GetLocation() const
virtual bool IsConstLiteral() const
virtual llvm::Expected< lldb::ValueObjectSP > Accept(Visitor *v) const =0
ASTNode & GetBase() const
ASTNode & GetIndex() const
BinaryOpKind GetKind() const
ASTNode & GetOperand() const
CompilerType GetType() const
ASTNode & GetFalseOperand() const
ASTNode & GetTrueOperand() const
ASTNode & GetCondition() const
const llvm::APFloat & GetValue() const
std::string GetName() const
uint32_t GetRadix() const
IntegerTypeSuffix GetTypeSuffix() const
const llvm::APInt & GetValue() const
llvm::Expected< lldb::ValueObjectSP > EvaluateBinaryRemainder(lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, uint32_t location)
llvm::Error ValidateComparison(BinaryOpKind kind, lldb::ValueObjectSP &lhs, lldb::ValueObjectSP &rhs, bool lhs_is_literal, bool rhs_is_literal, uint32_t location)
llvm::Expected< lldb::ValueObjectSP > Evaluate(const ASTNode &node)
Evaluate an ASTNode.
llvm::Expected< lldb::ValueObjectSP > EvaluateBinaryAddition(lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, uint32_t location)
llvm::Expected< lldb::ValueObjectSP > EvaluateAndDereference(const ASTNode &node)
Evaluate an ASTNode.
llvm::Expected< lldb::ValueObjectSP > PointerOffset(lldb::ValueObjectSP ptr, lldb::ValueObjectSP offset, BinaryOpKind operation, uint32_t location)
Add or subtract the offset to the pointer according to the pointee type byte size.
llvm::Expected< lldb::ValueObjectSP > EvaluateScalarOp(BinaryOpKind kind, lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, CompilerType result_type, uint32_t location)
llvm::Expected< CompilerType > PromoteSignedInteger(CompilerType &lhs_type, CompilerType &rhs_type)
If lhs_type is unsigned and rhs_type is signed, check whether it can represent all of the values of l...
llvm::Expected< lldb::ValueObjectSP > EvaluateBinaryShift(BinaryOpKind kind, lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, uint32_t location)
llvm::Expected< lldb::ValueObjectSP > EvaluateLogical(const BinaryOpNode &node)
llvm::Expected< lldb::ValueObjectSP > EvaluateBinarySubtraction(lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, uint32_t location)
llvm::Expected< lldb::ValueObjectSP > UnaryConversion(lldb::ValueObjectSP valobj, uint32_t location)
Perform usual unary conversions on a value.
llvm::Expected< lldb::ValueObjectSP > EvaluateComparison(BinaryOpKind kind, lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, bool lhs_is_literal, bool rhs_is_literal, uint32_t location)
llvm::Expected< lldb::ValueObjectSP > Visit(const IdentifierNode &node) override
bool m_check_ptr_vs_member
llvm::Expected< lldb::ValueObjectSP > EvaluateBinaryDivision(lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, uint32_t location)
lldb::DynamicValueType m_use_dynamic
llvm::Expected< CompilerType > ArithmeticConversion(lldb::ValueObjectSP &lhs, lldb::ValueObjectSP &rhs, uint32_t location)
Perform an arithmetic conversion on two values from an arithmetic operation.
llvm::Expected< lldb::ValueObjectSP > EvaluateBinaryMultiplication(lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, uint32_t location)
llvm::Expected< CastKind > VerifyCastType(lldb::ValueObjectSP operand, CompilerType source_type, CompilerType target_type, int location)
As a preparation for type casting, compare the requested 'target' type of the cast with the type of t...
Interpreter(lldb::TargetSP target, llvm::StringRef expr, StackFrame &stack_frame, lldb::DynamicValueType use_dynamic, uint32_t options)
llvm::Expected< CompilerType > PickIntegerType(lldb::TypeSystemSP type_system, ExecutionContextScope &ctx, const IntegerLiteralNode &literal)
llvm::Expected< lldb::ValueObjectSP > EvaluateAssignment(lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, uint32_t location)
llvm::Expected< CastKind > VerifyArithmeticCast(CompilerType source_type, CompilerType target_type, int location)
A helper function for VerifyCastType (below).
llvm::Expected< lldb::ValueObjectSP > EvaluateBinaryBitwise(BinaryOpKind kind, lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, uint32_t location)
StackFrame & m_stack_frame
llvm::StringRef GetFieldName() const
ASTNode & GetBase() const
ASTNode & GetNodeArg() const
CompilerType GetTypeArg() const
UnaryOpKind GetKind() const
ASTNode & GetOperand() const
CastKind
The type casts allowed by DIL.
@ eEnumeration
Casting from a scalar to an enumeration type.
@ ePointer
Casting to a pointer type.
@ eNone
Invalid promotion type (results in error).
@ eArithmetic
Casting to a scalar.
static lldb::BasicType BasicTypeToUnsigned(lldb::BasicType basic_type)
static bool IsLiteralZero(lldb::ValueObjectSP &val, bool is_literal)
static llvm::Expected< lldb::TypeSystemSP > GetTypeSystemFromCU(StackFrame &ctx)
lldb::ValueObjectSP LookupIdentifier(llvm::StringRef name_ref, StackFrame &stack_frame, lldb::DynamicValueType use_dynamic)
Given the name of an identifier (variable name, member name, type name, etc.), find the ValueObject f...
static CompilerType GetBasicType(lldb::TypeSystemSP type_system, lldb::BasicType basic_type)
static lldb::ValueObjectSP ArrayToPointerConversion(ValueObject &valobj, ExecutionContextScope &ctx, llvm::StringRef name)
BinaryOpKind
The binary operators recognized by DIL.
lldb::ValueObjectSP LookupGlobalIdentifier(llvm::StringRef name_ref, StackFrame &stack_frame, lldb::TargetSP target_sp, lldb::DynamicValueType use_dynamic)
Given the name of an identifier, check to see if it matches the name of a global variable.
static llvm::Expected< bool > VerifyAssignmentTypes(CompilerType lhs_type, CompilerType rhs_type)
lldb::ValueObjectSP LookupEnumValue(llvm::StringRef name_ref, ExecutionContextScope &ctx_scope)
Given the name of an identifier, attempt to find an enumeration value.
static size_t ConversionRank(CompilerType type)
Basic types with a lower rank are converted to the basic type with a higher rank.
static lldb::VariableSP DILFindVariable(ConstString name, VariableList &variable_list)
CompilerType ResolveTypeByName(const std::string &name, ExecutionContextScope &ctx_scope)
static bool HasFloatingRepresentation(CompilerType ct)
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
std::shared_ptr< lldb_private::TypeSystem > TypeSystemSP
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
@ eBasicTypeUnsignedShort
@ eBasicTypeUnsignedInt128
@ eBasicTypeUnsignedLongLong
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
LanguageType
Programming language type.
@ eLanguageTypeObjC
Objective-C.
std::shared_ptr< lldb_private::VariableList > VariableListSP
std::shared_ptr< lldb_private::Variable > VariableSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
Every register is described in detail including its name, alternate name (optional),...