|
LLDB mainline
|
#include <DILEval.h>
Public Member Functions | |
| Interpreter (lldb::TargetSP target, llvm::StringRef expr, std::shared_ptr< StackFrame > frame_sp, lldb::DynamicValueType use_dynamic, bool use_synthetic, bool fragile_ivar, bool check_ptr_vs_member) | |
| llvm::Expected< lldb::ValueObjectSP > | Evaluate (const ASTNode &node) |
| Evaluate an ASTNode. | |
Private Member Functions | |
| llvm::Expected< lldb::ValueObjectSP > | EvaluateAndDereference (const ASTNode &node) |
| Evaluate an ASTNode. | |
| llvm::Expected< lldb::ValueObjectSP > | Visit (const IdentifierNode &node) override |
| llvm::Expected< lldb::ValueObjectSP > | Visit (const MemberOfNode &node) override |
| llvm::Expected< lldb::ValueObjectSP > | Visit (const UnaryOpNode &node) override |
| llvm::Expected< lldb::ValueObjectSP > | Visit (const ArraySubscriptNode &node) override |
| llvm::Expected< lldb::ValueObjectSP > | Visit (const BitFieldExtractionNode &node) override |
| llvm::Expected< lldb::ValueObjectSP > | Visit (const IntegerLiteralNode &node) override |
| llvm::Expected< lldb::ValueObjectSP > | Visit (const FloatLiteralNode &node) override |
| llvm::Expected< lldb::ValueObjectSP > | Visit (const BooleanLiteralNode &node) override |
| llvm::Expected< lldb::ValueObjectSP > | Visit (const CastNode &node) override |
| llvm::Expected< lldb::ValueObjectSP > | UnaryConversion (lldb::ValueObjectSP valobj, uint32_t location) |
| Perform usual unary conversions on a value. | |
| llvm::Expected< CompilerType > | PickIntegerType (lldb::TypeSystemSP type_system, std::shared_ptr< ExecutionContextScope > ctx, const IntegerLiteralNode &literal) |
| llvm::Expected< CastKind > | VerifyArithmeticCast (CompilerType source_type, CompilerType target_type, int location) |
| A helper function for VerifyCastType (below). | |
| 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 the operand to be cast. | |
| Private Member Functions inherited from lldb_private::dil::Visitor | |
| virtual | ~Visitor ()=default |
Private Attributes | |
| lldb::TargetSP | m_target |
| llvm::StringRef | m_expr |
| lldb::ValueObjectSP | m_scope |
| std::shared_ptr< StackFrame > | m_exe_ctx_scope |
| lldb::DynamicValueType | m_use_dynamic |
| bool | m_use_synthetic |
| bool | m_fragile_ivar |
| bool | m_check_ptr_vs_member |
| lldb_private::dil::Interpreter::Interpreter | ( | lldb::TargetSP | target, |
| llvm::StringRef | expr, | ||
| std::shared_ptr< StackFrame > | frame_sp, | ||
| lldb::DynamicValueType | use_dynamic, | ||
| bool | use_synthetic, | ||
| bool | fragile_ivar, | ||
| bool | check_ptr_vs_member ) |
Definition at line 259 of file DILEval.cpp.
References m_check_ptr_vs_member, m_exe_ctx_scope, m_expr, m_fragile_ivar, m_target, m_use_dynamic, and m_use_synthetic.
| llvm::Expected< lldb::ValueObjectSP > lldb_private::dil::Interpreter::Evaluate | ( | const ASTNode & | node | ) |
Evaluate an ASTNode.
Definition at line 268 of file DILEval.cpp.
References lldb_private::dil::ASTNode::Accept(), lldb_private::dil::ASTNode::GetLocation(), and m_expr.
Referenced by lldb_private::StackFrame::DILGetValueForVariableExpressionPath(), EvaluateAndDereference(), Visit(), Visit(), Visit(), and Visit().
|
private |
Evaluate an ASTNode.
If the result is a reference, it is also dereferenced using ValueObject::Dereference.
Definition at line 281 of file DILEval.cpp.
References error(), and Evaluate().
|
private |
Definition at line 722 of file DILEval.cpp.
References lldb::eBasicTypeInt, lldb::eBasicTypeInvalid, lldb::eBasicTypeLong, lldb::eBasicTypeLongLong, lldb::eBasicTypeUnsignedInt, lldb::eBasicTypeUnsignedLong, lldb::eBasicTypeUnsignedLongLong, lldb_private::CompilerType::GetBitSize(), lldb_private::dil::ASTNode::GetLocation(), lldb_private::dil::IntegerLiteralNode::GetRadix(), lldb_private::dil::IntegerLiteralNode::GetTypeSuffix(), lldb_private::dil::IntegerLiteralNode::GetValue(), lldb_private::dil::IntegerLiteralNode::IsUnsigned(), lldb_private::dil::Long, m_expr, and lldb_private::dil::None.
Referenced by Visit().
|
private |
Perform usual unary conversions on a value.
At the moment this includes array-to-pointer and integral promotion for eligible types.
Definition at line 83 of file DILEval.cpp.
References lldb_private::dil::ArrayToPointerConversion(), lldb_private::ValueObject::CreateValueObjectFromScalar(), lldb::eBasicTypeInt, lldb::eBasicTypeUnsignedInt, lldb_private::dil::GetBasicType(), lldb_private::CompilerType::GetBitSize(), lldb_private::dil::GetTypeSystemFromCU(), lldb_private::CompilerType::IsArrayType(), lldb_private::CompilerType::IsInteger(), lldb_private::CompilerType::IsSigned(), m_exe_ctx_scope, m_expr, and m_target.
Referenced by Visit().
|
private |
A helper function for VerifyCastType (below).
This performs arithmetic-specific checks. It should only be called if the target_type is a scalar type.
Definition at line 813 of file DILEval.cpp.
References lldb_private::dil::eArithmetic, lldb_private::CompilerType::GetByteSize(), lldb_private::CompilerType::IsBoolean(), lldb_private::CompilerType::IsEnumerationType(), lldb_private::CompilerType::IsFloat(), lldb_private::CompilerType::IsNullPtrType(), lldb_private::CompilerType::IsPointerType(), lldb_private::CompilerType::IsScalarType(), m_exe_ctx_scope, m_expr, and lldb_private::CompilerType::TypeDescription().
Referenced by VerifyCastType().
|
private |
As a preparation for type casting, compare the requested 'target' type of the cast with the type of the operand to be cast.
If the cast is allowed, return the appropriate CastKind for the cast; otherwise return an error.
Definition at line 876 of file DILEval.cpp.
References lldb_private::dil::eEnumeration, lldb_private::dil::ePointer, lldb_private::CompilerType::IsArrayType(), lldb_private::CompilerType::IsEnumerationType(), lldb_private::CompilerType::IsInteger(), lldb_private::CompilerType::IsNullPtrType(), lldb_private::CompilerType::IsPointerType(), lldb_private::CompilerType::IsScalarType(), m_expr, lldb_private::CompilerType::TypeDescription(), and VerifyArithmeticCast().
Referenced by Visit().
|
overrideprivatevirtual |
Implements lldb_private::dil::Visitor.
Definition at line 521 of file DILEval.cpp.
References lldb::eLanguageTypeObjC, lldb::eNoDynamicValues, Evaluate(), EvaluateAndDereference(), lldb_private::dil::ArraySubscriptNode::GetBase(), lldb_private::StreamString::GetData(), lldb_private::dil::ArraySubscriptNode::GetIndex(), lldb_private::dil::ASTNode::GetLocation(), lldb_private::CompilerType::IsArrayType(), lldb_private::CompilerType::IsPointerToVoid(), lldb_private::CompilerType::IsPointerType(), lldb_private::CompilerType::IsScalarType(), m_expr, m_use_dynamic, and m_use_synthetic.
|
overrideprivatevirtual |
Implements lldb_private::dil::Visitor.
Definition at line 677 of file DILEval.cpp.
References EvaluateAndDereference(), lldb_private::dil::BitFieldExtractionNode::GetBase(), lldb_private::dil::BitFieldExtractionNode::GetFirstIndex(), lldb_private::dil::BitFieldExtractionNode::GetLastIndex(), lldb_private::dil::ASTNode::GetLocation(), and m_expr.
|
overrideprivatevirtual |
Implements lldb_private::dil::Visitor.
Definition at line 807 of file DILEval.cpp.
References lldb_private::ValueObject::CreateValueObjectFromBool(), lldb_private::dil::BooleanLiteralNode::GetValue(), and m_target.
|
overrideprivatevirtual |
Implements lldb_private::dil::Visitor.
Definition at line 921 of file DILEval.cpp.
References lldb_private::dil::ArrayToPointerConversion(), lldb_private::ValueObject::CreateValueObjectFromAddress(), lldb_private::dil::eArithmetic, lldb_private::dil::eEnumeration, lldb_private::dil::eNone, lldb_private::dil::ePointer, error(), Evaluate(), lldb_private::dil::ASTNode::GetLocation(), lldb_private::CompilerType::GetNonReferenceType(), lldb_private::dil::CastNode::GetOperand(), lldb_private::dil::CastNode::GetType(), lldb_private::CompilerType::IsArrayType(), lldb_private::CompilerType::IsEnumerationType(), lldb_private::CompilerType::IsFloat(), lldb_private::CompilerType::IsInteger(), lldb_private::CompilerType::IsNullPtrType(), lldb_private::CompilerType::IsPointerType(), lldb_private::CompilerType::IsReferenceType(), lldb_private::CompilerType::IsScalarType(), lldb_private::CompilerType::IsSigned(), m_exe_ctx_scope, m_expr, m_target, lldb_private::CompilerType::TypeDescription(), and VerifyCastType().
|
overrideprivatevirtual |
Implements lldb_private::dil::Visitor.
Definition at line 785 of file DILEval.cpp.
References lldb_private::ValueObject::CreateValueObjectFromScalar(), lldb::eBasicTypeDouble, lldb::eBasicTypeFloat, lldb_private::dil::GetBasicType(), lldb_private::dil::ASTNode::GetLocation(), lldb_private::dil::GetTypeSystemFromCU(), lldb_private::dil::FloatLiteralNode::GetValue(), m_exe_ctx_scope, m_expr, and m_target.
|
overrideprivatevirtual |
Implements lldb_private::dil::Visitor.
Definition at line 297 of file DILEval.cpp.
References lldb_private::dil::ASTNode::GetLocation(), lldb_private::dil::IdentifierNode::GetName(), lldb_private::dil::LookupGlobalIdentifier(), lldb_private::dil::LookupIdentifier(), m_exe_ctx_scope, m_expr, m_target, and m_use_dynamic.
|
overrideprivatevirtual |
Implements lldb_private::dil::Visitor.
Definition at line 761 of file DILEval.cpp.
References lldb_private::ValueObject::CreateValueObjectFromScalar(), lldb_private::dil::GetTypeSystemFromCU(), lldb_private::dil::IntegerLiteralNode::GetValue(), m_exe_ctx_scope, m_target, PickIntegerType(), and lldb_private::Scalar::TruncOrExtendTo().
|
overrideprivatevirtual |
Implements lldb_private::dil::Visitor.
Definition at line 412 of file DILEval.cpp.
References lldb::eNoDynamicValues, Evaluate(), lldb_private::Status::Fail(), lldb_private::dil::MemberOfNode::GetBase(), lldb_private::dil::MemberOfNode::GetFieldName(), lldb_private::dil::MemberOfNode::GetIsArrow(), lldb_private::dil::ASTNode::GetLocation(), lldb_private::CompilerType::GetPointeeType(), m_check_ptr_vs_member, m_expr, m_fragile_ivar, m_use_dynamic, m_use_synthetic, and lldb_private::Status::Success().
|
overrideprivatevirtual |
Implements lldb_private::dil::Visitor.
Definition at line 317 of file DILEval.cpp.
References lldb_private::dil::AddrOf, lldb_private::ValueObject::CreateValueObjectFromScalar(), lldb_private::dil::Deref, error(), Evaluate(), lldb_private::dil::UnaryOpNode::GetKind(), lldb_private::dil::ASTNode::GetLocation(), lldb_private::dil::UnaryOpNode::GetOperand(), lldb_private::CompilerType::GetTypeName(), lldb_private::CompilerType::IsPointerType(), lldb_private::CompilerType::IsScalarType(), m_expr, m_target, m_use_dynamic, m_use_synthetic, lldb_private::dil::Minus, lldb_private::dil::Plus, UnaryConversion(), and lldb_private::Scalar::UnaryNegate().
|
private |
Definition at line 105 of file DILEval.h.
Referenced by Interpreter(), and Visit().
|
private |
Definition at line 101 of file DILEval.h.
Referenced by Interpreter(), UnaryConversion(), VerifyArithmeticCast(), Visit(), Visit(), Visit(), and Visit().
|
private |
Definition at line 99 of file DILEval.h.
Referenced by Evaluate(), Interpreter(), PickIntegerType(), UnaryConversion(), VerifyArithmeticCast(), VerifyCastType(), Visit(), Visit(), Visit(), Visit(), Visit(), Visit(), and Visit().
|
private |
Definition at line 104 of file DILEval.h.
Referenced by Interpreter(), and Visit().
|
private |
|
private |
Definition at line 98 of file DILEval.h.
Referenced by Interpreter(), UnaryConversion(), Visit(), Visit(), Visit(), Visit(), Visit(), and Visit().
|
private |
|
private |